push all element back to matrix in reverse order
i = row NEW_LINE k = j NEW_LINE while ( i < n and k >= 0 ) : NEW_LINE INDENT mat [ i ] [ k ] = s [ - 1 ] NEW_LINE k -= 1 NEW_LINE i += 1 NEW_LINE s . pop ( ) NEW_LINE DEDENT