Given a binary matrix, return the number of submatrices (rectangles) that contain only 1s. Input: JSON 2D grid of 0/1.
Input: A JSON 2D 0/1 grid.
Output: Integer — count of all-ones submatrices.
Input: [[1,0,1],[1,1,0],[1,1,0]]
Output: 13
Explanation: 13 all-ones submatrices.Input: [[1]]
Output: 1
Explanation: Single 1.Input: [[0]]
Output: 0
Explanation: No ones.1<=m,n<=150grid[i][j] in {0,1}