gondola.cpp: In function 'int replacement(int, int*, int*)':
gondola.cpp:50:24: error: 'val' was not declared in this scope; did you mean 'valid'?
50 | for(int i=1;i<=n;i++)val[i]=i;
| ^~~
| valid
gondola.cpp:52:26: error: 'val' was not declared in this scope; did you mean 'valid'?
52 | for(int i=pos;i<=n;i++)val[i]=s[pos]+i-pos;
| ^~~
| valid
gondola.cpp:53:25: error: 'val' was not declared in this scope; did you mean 'valid'?
53 | for(int i=1;i<pos;i++)val[i]=val[n]+i;
| ^~~
| valid
gondola.cpp:56:7: error: 'val' was not declared in this scope; did you mean 'valid'?
56 | if(val[i]>n)val[i]-=n;
| ^~~
| valid
gondola.cpp:62:26: error: 'val' was not declared in this scope; did you mean 'valid'?
62 | replacementSeq[i-n-1]=val[maxs];
| ^~~
| valid
gondola.cpp:65:26: error: 'val' was not declared in this scope; did you mean 'valid'?
65 | replacementSeq[i-n-1]=val[where[i]];
| ^~~
| valid