Trie interview. Question should be updated and also 1 test case not passing

I have 2 doubts-

  1. They should change condition in question to b<c instead of b<=c because then for sample test case if b<=c then for a=1,b=3,c=3,d=4 we get answer 19 as (1^2^6) + (6^8) = 19.

  2. I am getting MLE in one test case. How to fix this.

I have made 2 tries and i am trying to solve this problem by breaking it down into 2 max subarray xor type problems. I break the array at a point and consider max subarray xor in left and right array.

I have added conditions that minimum number of elements in subarray being considered are 2. And in each subarray avoid those answers where through subarray maxXor algorithm we get ans equal to ending element being considered i.e it is considering only one element.