You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#Note: "Greedy Method": Finding optimal solution in that point, can be of lowest or highest at that point.
# In this question, we are using the first list i.e gas, and visting each of the given numbers, and whenever the sum of gas is more than sum cost, then we will move to the next index with adding index + 1.