Maximum Submatrix Leetcode Problems Javascript