XOR key Discussions | Algorithms | HackerRank
  • + 0 comments

    This is my code but I am getting timeout exceeded and I am not able to optimize further

    def xorKey(x, queries):
        # Write your code here
        lst=[]
        for j in queries:
            a,l,r=j
            y=filter(lambda i:l<=i and i<=r,x)
            res=set([a^k for k in y])     
            lst.append(max(res))     
        return lst