Your question is Rotate Square Matrix In Place. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Given an n x n matrix of integers represented as a list of lists, rotate the matrix 90 degrees clockwise in place. Modify the input matrix directly and return it. You may not allocate another n x n matrix for the result.
def rotate_matrix(matrix):