Maximum Width Ramp Leetcode Javascript