#include <bits/stdc++.h>
#define i2 array<int,2>
using namespace std;
const int N = 300100;
const int oo = 2e9;
int st[4 * N], MX[4 * N];
int n, f[N], p[N], pre[N], dir[N], ans[N];

// 0 -- left, 1 -- right

void build(int v, int l, int r){
    st[v] = oo;

    if (l == r) {
        MX[v] = p[l] + l;
        return;
    }

    int md = (l + r) >> 1;

    build(v + v, l, md);
    build(v + v + 1, md + 1, r);

    MX[v] = max(MX[v + v], MX[v + v + 1]);
}

void update(int v, int l, int r, int ps, int vl){
    if (l == r) {
        st[v] = min(st[v], vl);
        return;
    }

    int md = (l + r) >> 1;

    if (ps <= md)
        update(v + v, l, md, ps, vl);
    else update(v + v + 1, md + 1, r, ps, vl);

    st[v] = min(st[v + v], st[v + v + 1]);
}

int get_loc(int v, int tl, int tr, int l, int r){
    if (l > r) return oo;

    if (tl == l && tr == r) return st[v];

    int md = (tl + tr) >> 1;

    return min(get_loc(v + v, tl, md, l, min(r, md)),
               get_loc(v + v + 1, md + 1, tr, max(md + 1, l), r));
}

int get_max(int v, int tl, int tr, int l, int r){
    if (l > r) return 0;

    if (tl == l && tr == r) return MX[v];

    int md = (tl + tr) >> 1;

    return max(get_max(v + v, tl, md, l, min(r, md)),
               get_max(v + v + 1, md + 1, tr, max(md + 1, l), r));
}

int main(){
    ios_base::sync_with_stdio(0); cin.tie(0);

#ifdef _LOCAL
    freopen("in.txt","r",stdin);
#endif // _LOCAL

    int qq; cin >> qq;

    for (; qq; qq--){
        cin >> n;

        fill(f, f + n + 1, 0);

        for (int i = 1; i <= n; i++)
            cin >> p[i];

        build(1, 0, n);

        update(1, 0, n, 0, 0);

        // if BAD you can't recalc

        for (int i = 1; i <= n; i++){
            // from i - 1
            // from j
            // max(left_bound, 0)

            f[i] = -1;

            if (f[i - 1] >= i){
                pre[i] = i - 1;
                dir[i] = 1;
                f[i] = max(f[i - 1], p[i] + i);
            }

            {
                int loc = get_loc(1, 0, n, max(0, i - p[i] - 1), n);

                if (loc < oo){
                    int nw = max(i - 1, get_max(1, 0, n, loc + 1, i - 1));

                    if (nw > f[i]){
                        pre[i] = loc;
                        dir[i] = 0;
                        f[i] = nw;
                    }
                } else {
                    if (f[i] < f[i - 1]){
                        f[i] = f[i - 1];
                        pre[i] = i - 1;
                        dir[i] = 1;
                    }
                }
            }

            update(1, 0, n, f[i], i);
        }

        if (f[n] < n)
            cout << "NO\n";
        else {
            cout << "YES\n";

            int j = n;

            while (j > 0){
                ans[j] = dir[j];

                if (!dir[j]){
                    for (int i = pre[j] + 1; i < j; i++)
                        ans[i] = 1;
                }

                j = pre[j];
            }

            for (int i = 1; i <= n; i++)
                cout << (ans[i] ? 'R' : 'L');

            cout << '\n';
        }
    }

    return 0;
}
