Count Square Submatrices with All Ones | Dynamic Programming | Leetcode 1277