Click here to see the full article post
It's an awesome solution. But may I ask why we traverse from left to right to build "sum" instead of traversing right to left?
@yujun you can do that as well.
We can use a variable to record the maximum count each time when putting keys to the map. Hence we do not need to traverse the map's keySet().
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.