573. Squirrel Simulation
ArrayMath
Hints
Hint 1
Will Brute force solution works here? What will be its complexity?
Hint 2
Brute force definitely won't work here. Think of some simple solution. Take some example and make some observations.
Hint 3
Will order of nuts traversed by squirrel is important or only first nut traversed by squirrel is important?
Hint 4
Are there some paths which squirrel have to cover in any case? If yes, what are they?
Hint 5
Did you notice only first nut traversed by squirrel matters? Obviously squirrel will choose first nut which will result in minimum distance.
Preparing judge…