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
|
3971 Discussions
|
Please Login in order to post a comment
This is my code in js:
THIS IS MY PYTHON CODE:
Nowhere in the problem statement does it say that time must be an integer for a solution to be accepted. However it seems the solution assumes this since the testcase: 21 6 47 3 has a meeting point at the integer 71 but a non-integer time and is meant to return "NO".
How to report this? This should either return "YES" as the solution, or it should be made clear that the solution should also be for integer time.
` # - The one who starts behind is too slow to catch up # - OR the one ahead is too fast to ever be caught # - n is not an integer > They never land on the same spot return 'YES' if n >= 0 else 'NO' return 'NO'
#
Python: O(1) solution