[LeetCode] Count All Possible Routes

1 · · Feb. 11, 2022, 4:06 a.m.
1575. Count All Possible Routes You are given an array of distinct positive integers locations where locations[i] represents the position of city i. You are also given integers start, finish and fuel representing the starting city, ending city, and the initial amount of fuel you have, respectively. At each step, if you are at city i, you can pick any city j such that j != i and 0 <= j < locations.length and move to city j. Moving from city i to city j reduces the amount of fuel you have by |loc...