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.
Number Line Jumps
Number Line Jumps
Sort by
recency
|
3974 Discussions
|
Please Login in order to post a comment
def kangaroo(x1, v1, x2, v2):
1224
My code:-
public static String kangaroo(int x1, int v1, int x2, int v2) { while(!((v1>v2&&x1>x2)||(v2>v1&&x2>x1)||(v1==v2&&x1!=x2))) { if(x1==x2) return "YES"; x1+=v1; x2+=v2; } return "NO"; }
This is my code in js:
THIS IS MY PYTHON CODE: