Loop to iterate over all the possible positions of the given matrix mat [ ] [ ]
for i in range ( k - 1 , dim ) : NEW_LINE INDENT for j in range ( k - 1 , dim , 1 ) : NEW_LINE INDENT if ( i == ( k - 1 ) or j == ( k - 1 ) ) : NEW_LINE DEDENT DEDENT