Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function choreography(input) {
- let steps = Number(input[0]);
- let dancers = Number(input[1]);
- let days = Number(input[2]);
- let dayStepPercent = Math.ceil(steps / days / steps * 100);
- let dancerStepPercent = dayStepPercent / dancers;
- if (dayStepPercent < 13) {
- console.log(`Yes, they will succeed in that goal! ${dancerStepPercent.toFixed(2)}%.`);
- } else {
- console.log(`No, they will not succeed in that goal! Required ${dancerStepPercent.toFixed(2)}% steps to be learned per day.`);
- }
- return;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement