I am unable to detect error in the code

int Solution::snakeLadder(vector<vector > &A, vector<vector > &B)
{
unordered_map<int,int>m;
for(int i=0;i<A.size();i++)
{
m[A[i][0]]=m[A[i][1]];
}
for(int i=0;i<B.size();i++)
{
m[B[i][0]]=m[B[i][1]];
}
queueq;
int moves=0;
q.push(1);
bool visi[101]={false};
int found=0;
visi[1]=true;
int y;
while(!q.empty() && found!=1)
{
int s=q.size();
while(s–)
{
int x=q.front();
q.pop();
for(int j=1;j<=6;j++)
{
y=x+j;
if(y==100)
{
found=1;
break;
}
if(m.find(y)!=m.end() && visi[y]==false && y<=100)
{
y=m[y];
}
if(m.find(y)==m.end() && visi[y]==false && y<=100)
{
y=m[y];
}
if(visi[y]==false && y<=100)
{
visi[y]=true;
q.push(y);
}
}
}
moves++;
}
if(found==1)
{
return moves;
}
else
{
return -1;
}
}

my code is failing on this testcase

hi @subhamkumar341768
Kindly share the ques link… and save ur code on coding Blocks ide and send link…

@subhamkumar341768
u can refer my code for the snake and ladders board problem in the course contents -->

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.