Regarding golf question of may challenge (div 3)

the logic i used is that ball jumps k steps ahead in forward direction and n+1-k steps in backward respectively but all my guessed test cases passed including question given test cases … help me out .

1 Like

if(x%k==0 || (n+1-x)%k==0)

It was a simple one… I hope now you’ll understand it your own

Did this really need another thread?

1 Like

I tried your suggestions sir but it is not working out after submittion still… I am worried why my answer is not right…after all those test cases

I already understood this solution …sir