//A CPP Solution by Ayush Chaudhari
//Time Complexity=O(n^2)

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
const int sz = 3e5+7;

int n, a[sz], dp[sz], bit[sz], tree[sz<<1], who[sz];
char ans[sz];

void update(int x, int v) {
   while(x) {
      bit[x] = min(bit[x], v);
      x -= x & -x;
   }
}

int query(int x) {
   int res = sz;
   while(x <= n) {
      res = min(res, bit[x]);
      x += x & -x;
   }
   return res;
}

int big(int l, int r) {
   l += n-1, r += n;
   int res = 0;
   while(l < r) {
      if(l & 1) res = max(res, tree[l++]);
      if(r & 1) res = max(tree[--r], res);
      l >>= 1, r >>= 1;
   }
   return res;
}

void solve() {
  
   scanf("%d", &n);

   if(n==1){
        if(a[0]==0) puts("NO");
        else{
            puts("YES");
            puts("L");
        }
        return;
    }
        
   for(int i=1; i<=n; i++) scanf("%d", &a[i]), bit[i] = sz, tree[n+i-1] = i + a[i];
   for(int i=n-1; i>=0; i--) tree[i] = max(tree[i<<1], tree[i<<1|1]);

   for(int i=2; i<=n; i++) {
      dp[i] = dp[i-1]; who[i] = i-1;
      if(dp[i] > i) dp[i] = max(dp[i], i + a[i] + 1);
      if(a[i]) {
         int j = i - a[i] <= 1 ? 0 : query(i - a[i]);
         if(j < i) {
            int now = max(i, big(j + 1, i - 1) + 1);
            if(now > dp[i]) dp[i] = now, who[i] = -j;
         }
      }
      update(dp[i], i);
   }
   if(dp[n] > n) {
      puts("YES");
      fill(ans, ans+n, 'R'); ans[n] = 0;
      int i = upper_bound(dp, dp+n+1, n) - dp;
      while(i > 1) {
         if(who[i] <= 0) ans[i-1] = 'L';
         i = abs(who[i]);
      }
      puts(ans);
   }
   else puts("NO");
}

int main() {
   int t;
   cin >> t;
   while(t--) solve();
}