Help in KMXOR of this Cookoff

Can someone please help in figuring out what I’m doing wrong in KMXOR of COOK94 here.

some cases are not properly handled,
take this n=5 k=2 giving wrong answer

It will be tough for someone who is not you to get through your code. You can use someone else’s AC solution, run it on some generated inputs, and compare it to what your solution produces. Then you’ll know which test cases fail.

This link has editorial

Thanxx a lot!!

I tried as much as I can, eventually I assumed I might be missing something significant, so thought of asking here.

Anyways, will keep your advice in mind next time.

1 Like

yeah though I appreciate this ques as I get experience of understanding someone’s code and I like to help people stuck at one soln for hours because I am also a coder and I know how it feels when we can’t help our code for hours :slight_smile:
Though I strongly recommend to solve error of our code by ourself as it helps us a lot, but asking if we are about to give up the que is also fine…