do check for 8 5 3 answer should be 5

x=A%B;

return (x+c-1)%B

this is a wrong solution but being accepted as it does not work on 8 5 3

this gives 0 but answer should be 5(same in expected output)

do check for 8 5 3 answer should be 5

x=A%B;

return (x+c-1)%B

this is a wrong solution but being accepted as it does not work on 8 5 3

this gives 0 but answer should be 5(same in expected output)

THOUGH RIGHT ONE IS ALSO GETTING ACCEPTED !

int Solution::solve(int A, int B, int C)

{

int cir = (C+A-1) % B;

if(cir == 0)

return B;

return cir;

}