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.
In this test case, for any point from 0 up to 10 the sum of the moves will be 10. If you pick 0, then the one that starts with 10 does 10 moves. If you start with 10, then the one that starts at 0 does 10 moves. If you pick 5, then each one moves 5. There are more answers that all sum to 10, but only 0 is acceptable because it is the one that provides the lexicographically smallest set of coordinates.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Hyperspace Travel
You are viewing a single comment's thread. Return to all comments →
Consider this test case:
2, 1
0
10
In this test case, for any point from 0 up to 10 the sum of the moves will be 10. If you pick 0, then the one that starts with 10 does 10 moves. If you start with 10, then the one that starts at 0 does 10 moves. If you pick 5, then each one moves 5. There are more answers that all sum to 10, but only 0 is acceptable because it is the one that provides the lexicographically smallest set of coordinates.