55>differentSquares
Given a rectangular matrix containing only digits, calculate the number of different 2 × 2 squares in it. ExampleFormatrix = [[1, 2, 1], [2, 2, 2], [2, 2, 2], [1, 2, 3], [2, 2, 1]] the output should be differentSquares(matrix) = 6. Here are all 6 different 2 × 2 squares:1 22 2 2 12 2 2 22 2 2 21 2 2 22 3 2 32 1 code>> int differentSquares(std::vector matrix) { std::set s; for (int i = 1; i