Guys , in the below TRIE tutorial in problem 2 , he explains a way to find maximum XOR subarray in a given array.But i find that the method illustrated requires O(n^2) operations as N times he queries the Trie each of which takes linear time.How does the solution pass the time limit. Trie Tutorial








Querying trie works O(log2(val)) because it's length is log2(val), so overall n * log2(max_ai).
Don't care about tries, just look at my new standup
Fun fact: tries over binary bits of values is actually a segment tree!
Querying the trie is therefore actually just querying a segment tree, O(log_base2(max_value)).