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.
You need to watch out for when v1 == v2 because then you will try modulus of 0. In this case or the more general case where v2 >= v1, the answer is always NO because the kangaroo just can't catch up.
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 →
You need to watch out for when v1 == v2 because then you will try modulus of 0. In this case or the more general case where v2 >= v1, the answer is always NO because the kangaroo just can't catch up.