Maximal Rectangle Area Leetcode Problems Javascript Function