Sum of all submatrix-1

Explanation could have been better in this video… :frowning: Difficult to understand the involvement of so many loops