Advertisement
Spocoman

Choreography

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