You are viewing a single comment's thread. Return to all comments →
function kangaroo(x1, v1, x2, v2) { // Write your code here
// Debug // 2081 8403 9107 8400 let answer = ""; let count = 0; let number = (x1 + v1 + x2 + v2) * 10 for( let i = 0; i <= number; i++){ count += x1 + (i * v1) === x2 + (i * v2) ? 1 : 0; } answer = count > 0 ? "YES" : "NO" return answer
}
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 →
function kangaroo(x1, v1, x2, v2) { // Write your code here
}