Kangaroo best approach

PHOTO EMBED

Mon Jun 20 2022 21:16:01 GMT+0000 (UTC)

Saved by @soyreynald #javascript #typescript

let max: number = 10000;

for (let n = 1; n < max; n++) {
  let dist1: number = x1 + (v1 * n);
  let dist2: number = x2 + (v2 * n);
  if (dist1 === dist2) return 'YES';        
}

return 'NO';
content_copyCOPY

This problem is nice, to practice cycles and logical skills.

https://www.hackerrank.com/challenges/kangaroo/problem?isFullScreen=true