We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
stringkangaroo(intx1,intv1,intx2,intv2){// Complete this function// x1+m*v1=x2+mv2 => m=(x1-x2)/(v2-v1) , m is steps and//m should not be negetive and //remainder should be zerointx=x1-x2;intv=v2-v1;if(v!=0){if(x%v==0&&x/v>0){return"YES";}else{return"NO";}}else{return"NO";}}
Number Line Jumps
You are viewing a single comment's thread. Return to all comments →
I think it is better to solve it this way:
It works