What's wrong with my code?BINARY STRINGS in NOV18A

my solution is this…
Solution: 21605893 | CodeChef in python 3
what’s wrong with my code when compared with this…
Solution: 21610227 | CodeChef in java

both are simple brute force but mine was TLE and the other was partially executed

@admin@vijju please help

check this in pypy which was accepted …
https://www.codechef.com/viewsolution/21606252

I used trie data structure with segment tree which was correct for only one test case.
Although the good thing was that there were no TLE for any other test case.

Maximum Xor Query is same as the above problem.