To what extent are you expected to prove that a greedy approach leads to the optimal solution?

For instance in 45. Jump Game II, the greedy solution has a better time and space complexity than the dp solution. But how do you know that it is correct. How much does the interviewer expect you to prove that the greedy always leads to the optimal solution?

Comments (0)