Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function softUniReception(input) {
- let first = Number(input[0]);
- let second = Number(input[1]);
- let third = Number(input[2]);
- let students = Number(input[3]);
- let counter = 1, hours = 0;
- while (students > 0) {
- students -= first + second + third;
- hours += counter % 3 == 0 && students > 0 ? 2 : 1;
- counter += 1;
- }
- console.log(`Time needed: ${hours}h.`);
- return;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement