#include <bits/stdc++.h>

#define pi 3.141592653589793
#define en 2.718281828459045
#define oo 0x3f3f3f3f3f3f3f3f
#define M7 1000000007
#define M3 998244353

#define lowbit(x) (x&(-x))
#define puts(x) cout<<(x)<<endl

using namespace std;

using ll = long long;
using uint = unsigned int;
using ull = unsigned long long;
using ii = pair<int,int>;

const int maxn=300005;

int n;
int p[maxn];
int dp[maxn];
pair<int,int> cl[maxn];

struct ZKW {
    int w;
    vector<int> v;
    void init(int n) {
        for(w=1;w<n+2;w<<=1);
        v.resize(w<<1);
        v.assign(w,0);
    }
    void readn(int n) {
        for(int i=1;i<=n;i++) 
            v[w+i]=p[i]+i;
        for(int i=w-1;i>=1;i--)
            v[i]=max(v[i<<1],v[i<<1|1]);
    }
    int query(int L,int R) {
        if(L>R) return 0;
        // cout<<"["<<L<<","<<R<<"] ";
        int res=0;
        for(int l=w+L-1,r=w+R+1;l^r^1;l>>=1,r>>=1) {
            if(~l&1) res=max(res,v[l^1]);
            if(r&1) res=max(res,v[r^1]);
        }
        // cout<<res<<endl;
        return res;
    }
} zkw;

void prepare() {
    
}

void input() {
    cin>>n;
    zkw.init(n);
    for(int i=1;i<=n;i++) cin>>p[i];
    zkw.readn(n);
}

void check(int &dp_old,ii &cl_old,int dp_new,ii cl_new) {
    if(dp_old<dp_new) {
        dp_old=dp_new;
        cl_old=cl_new;
    }
}

void solve() {
    for(int i=1;i<=n;i++) dp[i]=0;
    for(int i=1;i<=n;i++) cl[i]=ii(0,0);
    for(int i=1;i<=n;i++) {
        int l=0,r=i-1,res=-1;
        while(l<=r) {
            int mid=(l+r)>>1;
            if(dp[mid]>=i-p[i]-1) {
                r=mid-1;
                res=mid;
            }
            else l=mid+1;
        }
        // cout<<res<<endl;
        if(res!=-1) check(dp[i],cl[i],max(i-1,zkw.query(res+1,i-1)),ii(res,0));
        check(dp[i],cl[i],dp[i-1],ii(i-1,0));
        if(dp[i-1]>=i) check(dp[i],cl[i],max(dp[i-1],i+p[i]),ii(i-1,1));
        // cout<<cl[i].first<<" "<<cl[i].second<<" i: "<<i<<" which have "<<dp[i]<<endl;
    }
}

void printans(int x) {
    if(x==0) return;
    printans(cl[x].first);
    for(int i=cl[x].first+1;i<x;i++) cout<<"R";
    if(cl[x].second) cout<<"R";
    else cout<<"L";
}

void output() {
    if(dp[n]>=n) {
        puts("YES");
        printans(n);
        cout<<endl;
    }
    else {
        puts("NO");
    }
}

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    prepare();
    int T; cin>>T;
    for(int tes=1; tes<=T; tes++) {
        input();
        solve();
        output();
    }
    return 0;
}
