3 -23 bytes
source | link

R, 213213 190 bytes

-23 bytes thanks to Giuseppe.

function(L){m=matrix(rep(0:2,1:3),5,5);m[1
m[1,4]=m[2,5]=1
v=as.matrix(expand.gridv=combn(replicaterep(1:5,n),n<-sum(lengths(L)),1:5,F)))
v[whichv[,which(apply(v,12,function(z)all(sapply(L,function(x,y){,r=m[cbind(x,y)];r[r>0][1]<2}])r[r>0][1]<2,z)))>0),]
[1]]}

Try it online!Try it online!

If a solution exists, it outputs one or several solutions. If there is no solution, it outputs an empty matrixa row of (only column names)NA. If this output format is not acceptable, I can change it at a cost of a few bytes.

     Var1 Var2 Var3 Var4
[1,]    1    4    2    4
[2,]    1    4    2    5

corresponding to the solutionssolution RLSL and RLSV.

 Var1NA Var2NA Var3NA Var4NA

i.e. an empty matrix, meaning that there is no solution.

Explanation of a previous version (will update when I can):

R, 213 bytes

function(L){m=matrix(rep(0:2,1:3),5,5);m[1,4]=m[2,5]=1
v=as.matrix(expand.grid(replicate(n<-sum(lengths(L)),1:5,F)))
v[which(apply(v,1,function(z)all(sapply(L,function(x,y){r=m[cbind(x,y)];r[r>0][1]<2},z)))>0),]
}

Try it online!

If a solution exists, it outputs one or several solutions. If there is no solution, it outputs an empty matrix (only column names). If this output format is not acceptable, I can change it at a cost of a few bytes.

     Var1 Var2 Var3 Var4
[1,]    1    4    2    4
[2,]    1    4    2    5

corresponding to the solutions RLSL and RLSV.

 Var1 Var2 Var3 Var4

i.e. an empty matrix, meaning that there is no solution.

R, 213 190 bytes

-23 bytes thanks to Giuseppe.

function(L){m=matrix(rep(0:2,1:3),5,5)
m[1,4]=m[2,5]=1
v=combn(rep(1:5,n),n<-sum(lengths(L)))
v[,which(apply(v,2,function(z)all(sapply(L,function(x,y,r=m[cbind(x,y)])r[r>0][1]<2,z)))>0)[1]]}

Try it online!

If a solution exists, it outputs one. If there is no solution, it outputs a row of NA. If this output format is not acceptable, I can change it at a cost of a few bytes.

     1 4 2 4

corresponding to the solution RLSL.

 NA NA NA NA

meaning that there is no solution.

Explanation of a previous version (will update when I can):

2 -2 bytes: I had left 2 spaces…
source | link

R, 215213 bytes

function(L){m = matrixm=matrix(rep(0:2,1:3),5,5);m[1,4]=m[2,5]=1
v=as.matrix(expand.grid(replicate(n<-sum(lengths(L)),1:5,F)))
v[which(apply(v,1,function(z)all(sapply(L,function(x,y){r=m[cbind(x,y)];r[r>0][1]<2},z)))>0),]
}

Try it online!Try it online!

R, 215 bytes

function(L){m = matrix(rep(0:2,1:3),5,5);m[1,4]=m[2,5]=1
v=as.matrix(expand.grid(replicate(n<-sum(lengths(L)),1:5,F)))
v[which(apply(v,1,function(z)all(sapply(L,function(x,y){r=m[cbind(x,y)];r[r>0][1]<2},z)))>0),]
}

Try it online!

R, 213 bytes

function(L){m=matrix(rep(0:2,1:3),5,5);m[1,4]=m[2,5]=1
v=as.matrix(expand.grid(replicate(n<-sum(lengths(L)),1:5,F)))
v[which(apply(v,1,function(z)all(sapply(L,function(x,y){r=m[cbind(x,y)];r[r>0][1]<2},z)))>0),]
}

Try it online!

1
source | link

R, 215 bytes

function(L){m = matrix(rep(0:2,1:3),5,5);m[1,4]=m[2,5]=1
v=as.matrix(expand.grid(replicate(n<-sum(lengths(L)),1:5,F)))
v[which(apply(v,1,function(z)all(sapply(L,function(x,y){r=m[cbind(x,y)];r[r>0][1]<2},z)))>0),]
}

Try it online!

If a solution exists, it outputs one or several solutions. If there is no solution, it outputs an empty matrix (only column names). If this output format is not acceptable, I can change it at a cost of a few bytes.

Moves are coded as 1=R, 2=S, 3=P, 4=L, 5=V, so that the matrix of outcomes is

     [,1] [,2] [,3] [,4] [,5]
[1,]    0    2    2    1    1
[2,]    1    0    2    2    1
[3,]    1    1    0    2    2
[4,]    2    1    1    0    2
[5,]    2    2    1    1    0

(0=no winner; 1=player 1 wins; 2=player 2 wins)

An upper bound on the length of the solution if it exists is n=sum(lengths(L)) where L is the list of opponents' moves. The code creates all possible strategies of length n (stored in matrix v), tries all of them, and displays all winning strategies.

Note that this value of n makes the code very slow on TIO, so I have hardcoded in the TIO n=4 which is enough for the test cases.

For the first test case, the output is

     Var1 Var2 Var3 Var4
[1,]    1    4    2    4
[2,]    1    4    2    5

corresponding to the solutions RLSL and RLSV.

For the second test case, the output is

 Var1 Var2 Var3 Var4

i.e. an empty matrix, meaning that there is no solution.

function(L){
  m = matrix(rep(0:2,1:3),5,5);
  m[1,4]=m[2,5]=1                      # create matrix of outcomes
  v=as.matrix(expand.grid(replicate(   # all possible strategies of length n
    n<-sum(lengths(L))                 # where n is the upper bound on solution length
    ,1:5,F)))             
  v[which(    
    apply(v,1,                         # for each strategy
          function(z)                  # check whether it wins
            all(                       # against all opponents
              sapply(L,function(x,y){  # function to simulate one game
                r=m[cbind(x,y)];       # vector of pair-wise outcomes
                r[r>0][1]<2            # keep the first non-draw outcome, and verify that it is a win
              }
              ,z)))
    >0),]                              # keep only winning strategies
}

The which is necessary to get rid of NAs which occur when the two players draw forever.

I am not convinced this is the most efficient strategy. Even if it is, I am sure that the code for m could be golfed quite a bit.