#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,int> pli;
const int maxn=3e5+10;
const int max_logn=20;
const int INF=0x3f3f3f3f;
char s[maxn];
int p[maxn],rig[maxn][max_logn],mm[maxn];
int rmq(int l,int r)
{
    if(l>r) return 0;
    int k=mm[r-l+1];
    return max(rig[l][k],rig[r-(1<<k)+1][k]);
}
int mx[maxn<<2];
inline void pushup(int rt)
{
    mx[rt]=min(mx[rt<<1],mx[rt<<1|1]);
}
void build(int l,int r,int rt)
{
    mx[rt]=INF;
    if(l==r) return;
    int mid=l+r>>1;
    build(l,mid,rt<<1);
    build(mid+1,r,rt<<1|1);
}
void update(int pos,int val,int l,int r,int rt)
{
    if(l==r) {mx[rt]=min(mx[rt],val);return;}
    int mid=l+r>>1;
    if(pos<=mid) update(pos,val,l,mid,rt<<1);
    else update(pos,val,mid+1,r,rt<<1|1);
    pushup(rt);
}
int query(int L,int R,int l,int r,int rt)
{
    if(L<=l&&R>=r) return mx[rt];
    int mid=l+r>>1,ans=INF;
    if(L<=mid) ans=min(ans,query(L,R,l,mid,rt<<1));
    if(R>mid) ans=min(ans,query(L,R,mid+1,r,rt<<1|1));
    return ans;
}
int pre[maxn],dp[maxn];
int main()
{
    #ifdef local
    freopen("a.in","r",stdin);
    #endif
    mm[0]=0;
    for(int i=1;i<maxn;++i){
        mm[i]=mm[i-1];
        if(i==1<<(mm[i]+1)) ++mm[i];
    }
    int t,n;
    for(scanf("%d",&t);t--;){
        scanf("%d",&n);
        for(int i=1;i<=n;++i) scanf("%d",p+i),rig[i][0]=min(n,i+p[i]),s[i]='R',pre[i]=-1;
        for(int j=1;j<=mm[n];++j){
            for(int i=1;i+(1<<j)-1<=n;++i){
                rig[i][j]=max(rig[i][j-1],rig[i+(1<<(j-1))][j-1]);
            }
        }
        build(0,n,1);
        update(0,0,0,n,1);
        for(int i=1;i<=n;++i){
            dp[i]=dp[i-1];
            if(dp[i-1]>=i) dp[i]=max(dp[i-1],rig[i][0]);
            int pos=query(i-p[i]-1,n,0,n,1);
            if(pos==INF) continue;
            int r=max(i-1,rmq(pos+1,i-1));
            if(r>dp[i]) dp[i]=r,pre[i]=pos;
            update(dp[i],i,0,n,1);
        }
        if(dp[n]<n) puts("NO");
        else{
            for(int i=n;i;--i){
                if(pre[i]>=0){
                    s[i]='L';
                    for(int j=i-1;j>pre[i];--j) pre[j]=-1;
                }
            }
            s[n+1]='\0';
            puts("YES");
            printf("%s\n",s+1);
        }
    }
    return 0;
}