• + 1 comment

    I posted the greedy idea after passing all test cases. So it should be trustable. The intuition of physics can be justified using imagined incremental changes to rule out non-optimal choices. Then the optimal choice is one that is in "equilibrium".