AFZQ2019 CHOCOS failing testcase

Shouldn’t this accepted code fail https://www.codechef.com/viewsolution/27905274 , for this input?
3 3 1
001
Expected answer should be 2 as you can select all indexes and take their XOR with 1 to get 110.
But this solution gives 1 as answer.