You are viewing a single comment's thread. Return to all comments →
Simple solution in Java using boolean
public static String kangaroo(int x1, int v1, int x2, int v2) { boolean canMeet = v2 < v1 && ((x2 - x1) % (v1 - v2) == 0); return canMeet? "YES": "NO"; }
Seems like cookies are disabled on this browser, please enable them to open this website
An unexpected error occurred. Please try reloading the page. If problem persists, please contact support@hackerrank.com
Number Line Jumps
You are viewing a single comment's thread. Return to all comments →
Simple solution in Java using boolean