Very concise solution. The only thing I don't understand is why you iterate from m-1 to 0, not from 0 to m-1. Iterate from 0 to m-1won't give correct solution. Could you please explain? Thanks.
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.