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: #include <bits/stdc++.h>
#define ll long long int
using namespace std;
void solve()
{
    ll n;
    cin >> n;
    vector<vector<ll>> a(n, vector<ll>(n, 0));
    for (ll i = 0; i < n; i++)
    {
        for (ll j = 0; j < n; j++)
        {
            cin >> a[i][j];
        }
    }
    string s;
    cin >> s;
    ll count = 0;
    for (auto i : s)
    {
        if (i == 'R')
            count++;
        else
            count--;
    }
    if (count > 0)
    {
        while (count--)
        {
            for (ll i = 0; i < n; i++)
            {
                for (ll j = 0; j < i; j++)
                {
                    swap(a[i][j], a[j][i]);
                }
            }
            for (ll i = 0; i < n; i++)
            {
                for (ll j = 0; j < n / 2; j++)
                {
                    swap(a[i][j], a[i][n - 1 - j]);
                }
            }
        }
    }
    else
    {
        while (count++)
        {
            for (ll i = 0; i < n; i++)
            {
                for (ll j = 0; j < i; j++)
                {
                    swap(a[i][j], a[j][i]);
                }
            }
            for (ll j = 0; j < n; j++)
            {
                for (ll i = 0; i < n / 2; i++)
                {
                    swap(a[i][j], a[n - 1 - i][j]);
                }
            }
        }
    }
    for (ll i = 0; i < n; i++)
    {
        for (ll j = 0; j < n; j++)
        {
            cout << a[i][j] << " ";
        }
        cout << "\n";
    }
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    solve();
}, In this Programming Language: C++, Now tell me if this Code is compilable or not?