You are viewing a single comment's thread. Return to all comments →
JavaScript with O(n) complexity
function kangaroo(x1, v1, x2, v2) { for(let i=0;i<=10000;i++){ if(x1 === x2){ return 'YES' } x1+=v1 x2+=v2 } return 'NO' }
Number Line Jumps
You are viewing a single comment's thread. Return to all comments →
JavaScript with O(n) complexity