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're checking to see at what index you can reach the end of the array, nothing else. Why vastly overcomplicate the problem statement by stating otherwise? God forbid this problem show up on an Amazon coding prescreen with this explanation of what needs to be done.
All mentions of the word circle should be removed from the problem statement. The test cases do not test for this, and in fact some of the test cases its impossible to complete a circle as there is more distance than fuel.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Truck Tour
You are viewing a single comment's thread. Return to all comments →
You're checking to see at what index you can reach the end of the array, nothing else. Why vastly overcomplicate the problem statement by stating otherwise? God forbid this problem show up on an Amazon coding prescreen with this explanation of what needs to be done.
All mentions of the word circle should be removed from the problem statement. The test cases do not test for this, and in fact some of the test cases its impossible to complete a circle as there is more distance than fuel.