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.
If you’re looking for solutions to the 3-month preparation kit in either Python or Rust, you can find them below:
my solutions
defnumber_line_jumps(x1,v1,x2,v2):# Time complexity: O(1)# Space complexity (ignoring input): O(1)ifx1==x2:return"YES"ifv1==v2:return"NO"relative_speed=v2-v1initial_distance=x1-x2jumps=initial_distance/relative_speedifjumps==abs(int(jumps)):return"YES"return"NO"
Cookie support is required to access HackerRank
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 →
Python best solution
If you’re looking for solutions to the 3-month preparation kit in either Python or Rust, you can find them below: my solutions