Bloomberg NYC new grad phone question

Anonymous User
975
Oct 11, 2022

A rover is traversing the circumference of the moon. There are fuel stops along the way at different locations. The 2 inputs are the total distance and the array of locations and fuel amounts. Whats the furthest distance travelled?

100, [[0, 10], [10, 30], [60, 40]] //distance would be 80
// start at 60, go 40 
// reached 100; meaning circle back; add 10
// reached 10; add 30
50, [[0, 10]] //distance would be 10
// start at 0; add 10 fuel

Help with this question? It's supposedly an island question.

Comments (3)