For this Question: Newton being a student of science gifted an <b>nXn</b> matrix to his girlfriend on her birthday and challenge her to solve the matrix. The matrix consists of natural numbers up to 500(1 &le; n &le; 500). Newton instructed a few things about matrix to his girlfriend. He said there are two types of symbols on the matrix( L and R ), you need to rotate the matrix 90 degrees to the left for every L symbol and rotate the matrix 90 degrees right for every R symbol. The symbols were only 3 characters in length.
Help Newton's girlfriend to display the final matrix at the end of the complete turns.The first line consists of one integer n - the size of the matrix.
In the next n lines, you are given n integers, numbers can range from 1 to 500.

<b>Constraints<b>
1 &le; n &le; 500Output the final matrix n X n.

<b>Note</b> You should not print any whitespace or newline if it is not necessary.Sample input:
2
1 2
3 4
RLR

Sample output:
3 1
4 2, I have written this Solution Code: n = int(input())
matrix = []
for _ in range(n):
    matrix.append(input().strip().split())
symbols = list(input().strip())
instructions = sum(1 if i == 'R' else -1 for i in symbols)
if instructions in (1, -3):
    rotate_matrix = [['0'] * n for _ in range(n)]
    for i in range(n):
        for j in range(n):
            rotate_matrix[i][j] = matrix[n - j - 1][i]
    matrix = rotate_matrix
elif instructions in (-1, 3):
    rotate_matrix = [['0'] * n for _ in range(n)]
    for i in range(n):
        for j in range(n):
            rotate_matrix[i][j] = matrix[j][n - i - 1]
    matrix = rotate_matrix
for i in range(n):
    print(' '.join(matrix[i])), In this Programming Language: Python, Now tell me if this Code is compilable or not?