#include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <string>
#include <vector>
#include <cmath>
#include <queue>
#include <stack>
#include <map>

using namespace std;

typedef long long ll;

#define MAXN 300000 + 10

int t, n;
int a[MAXN];
int f[MAXN];
int fr[MAXN];
int h[MAXN];
int d[MAXN];

struct st {
    int c[MAXN][19];
    int lg[MAXN];
    void init() {
        for(int i = 2;i < MAXN; i++) lg[i] = lg[i / 2] + 1;
    }
    void pre () {
        for(int i = 1; i <= n; ++i) c[i][0] = a[i] + i;
        for(int i = 1; (1 << i) <= n; ++i)
            for(int j = 1; j + (1 << i) - 1 <= n; ++j)
                c[j][i] = max(c[j][i - 1], c[j + (1 << i - 1)][i - 1]);
    }
    int query (int l, int r) {
        if(l > r) return 0; 
        int T = lg[r - l + 1];
        // printf ("%d %d %d\n", l, r, max (c[l][t], c[r - (1 << t) + 1][t]));
        return max(c[l][T], c[r - (1 << T) + 1][T]);
    }
} A;

int main()
{
    scanf("%d", &t);
    A.init();
    while(t--) {
        scanf("%d", &n);
        a[n + 1] = 0;
        for(int i = 1;i <= n; i++) scanf("%d", &a[i]);
        for(int i = 1;i <= n + 1; i++) {
            f[i] = 0;
            fr[i] = 0;
            h[i] = 0;
        }
        A.pre();
        int maxn = -1, w = 0;
        for(int i = 1;i <= n + 1; i++) {
            int l = 0, r = i - 1;
            int j = -1;
            while(l <= r) {
                int mid = l + r >> 1;
                if(f[mid] + 1 >= i - a[i]) { j = mid; r = mid - 1; }
                else l = mid + 1;
            }
            if(j != -1) {
                f[i] = max(A.query(j + 1, i - 1), i - 1);
                fr[i] = j;
            }
            if(f[i - 1] >= i && f[i] < i + a[i]) {
                f[i] = i + a[i];
                fr[i] = i - 1;
                h[i] = 1;
            }
            if(maxn > f[i]) {
                f[i] = maxn;
                fr[i] = w;
            }
            else {
                maxn = f[i];
                w = i;
            }
        }
        if(f[n + 1] >= n) {
            for(int i = n + 1;i >= 1; i = fr[i]) {
                for(int j = fr[i] + 1;j < i; j++) {
                    d[j] = 1;
                }
                d[i] = h[i];
            }
            printf("YES\n");
            for(int i = 1;i <= n; i++) {
                printf("%c", (d[i] == 1) ? 'R' : 'L');
            }
            printf("\n");
        }
        else printf("NO\n");
    }
    return 0;
}