Hi everyone

Please can someone help me solve that challenge, I came up with many approaches to solve it but I failed in that, this my new approach

```
function saveThePrisoner(n, m, s) {
let counter = s-1;
let arr = [];
for(let i = 0; i < m; i++){
counter++;
arr.push(counter);
if(counter === n){
counter = 0;
}
}
return arr[arr.length - 1];
}
```

this is another approache but no one of these work:

```
function saveThePrisoner(n, m, s) {
let counter = s-1;
for(let i = 0; i < m; i++){
counter++;
if(counter === n){
counter = 0;
}
}
return counter;
}
```

here is the Link to the challenge if you want to take a look at: save the prisoner challenge