May LeetCoding Challenge #Day21 #Count Square Submatrices with All Ones #JAVA

    May LeetCoding Challenge[Day21] - Count Square Submatrices with All Ones

    Given a m * n matrix of ones and zeros, return how many square submatrices have all ones. Input: matrix = [ [0,1,1,1], [1,1,1,1], [0,1,1,1] ] Output: 15 Explanation: There are 10 squares of side 1. There are 4 squares of side 2. There is 1 square of side 3. Total number of squares = 10 + 4 + 1 = 15. 1. 알고리즘을 해결하기 위해서 생각한 방법 - 해당 문제는 0과 1로 이루어진 m * n 매트릭스가 주어질 때, 사각형이 몇 개인지 찾는 문제이다. - 길이가 1인 사각형부..