We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
functionkangaroo(x1:number,v1:number,x2:number,v2:number):string{// Write your code hereletposition1:number=x1;letposition2:number=x2;if(v2<v1){for(letx=0;x<10000;x++){position1+=v1;position2+=v2;if(position1===position2){return'YES';}}}return'NO';}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Number Line Jumps
You are viewing a single comment's thread. Return to all comments →