Maximal Rectangle Area Leetcode Problems Javascript For Loop