we need four loops to find all the submatrix of a matrix
for i in range ( 1 , n + 1 ) : NEW_LINE INDENT for j in range ( 1 , n + 1 ) : NEW_LINE INDENT for i1 in range ( i , n + 1 ) : NEW_LINE INDENT for j1 in range ( j , n + 1 ) : NEW_LINE DEDENT DEDENT DEDENT