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
|
3966 Discussions
|
Please Login in order to post a comment
In Java 15
public static String kangaroo(int x1, int v1, int x2, int v2) {
The problem statement isn't very clear.
It doesn't specify whether the kangaroos only have to meet at the end of a jump or does it count if they cross paths mid-jump as well
}****
def kangaroo(x1, v1, x2, v2): # Write your code here if(v1>v2 and ((x2-x1)%(v1-v2)==0)): return("YES") else: return('NO')