1504. Count Submatrices With All Ones Given an m x n binary matrix mat, return the number of submatrices that have…