Chef and Interactive XOR | INTXOR | Video Editorial | December Long

Video editorial of December Challenge 2018

Problem: Chef and Interactive XOR

Editorial: https://www.youtube.com/watch?v=yoJZj8OuFfk

1 Like

Good forum practices recommend posting a small intro/description in the thread instead of just posting the link. :slight_smile:

1 Like

Thanks for the suggestion :slight_smile:

Does your idea works with odd N?

If ask queries in this way, the last query will have just one possibility, where all the indexes are N, like query(N, N, N).

For odd N

only last two part will modify.

N = 9

1 2 3

1 2 4

3 4 5

3 4 6

5 6 7

5 6 8

7 8 9

7 9 1

8 9 2

now using 1 and 2 question we can find 3rd and 4th elements

1 Like

“Also, Chef has an additional condition: for each index x, x may appear in all questions in total at most 3 times” is clearly given in the problem statement , so this approach would fail as index 1 is used 4 times.

No, 1 is used only 3 times if N is odd also.

Thanks a lot for the solution. I was kind of stuck on the following pattern

a b c

b c d

a b d

a c d

I can find all solution using this pattern, but only if the N%4==0

1 Like

you’re welcome.

hii,can anyone please figure out the bug in my code, it was giving correct answer for all the manual testcases,yet was giving WA on submission.
link to my code link text

My solution link text uses the same tactics as your of even and odd,still last two cases fail i am still aware why my code is failing.You can test it too.