You are viewing a single comment's thread. Return to all comments →
public static String kangaroo(int x1, int v1, int x2, int v2) { String val = "NO"; int result1=x1, result2=x2; for(int i=0; i<=10000; i++){ if(result1 == result2){ val="YES"; break; } result1+=v1; result2+=v2; } return val; }
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 →