updated with time complexity and sample input-output

pull/892/head
jayjariwala96 2022-10-05 10:04:31 +05:30
parent a05e2425be
commit 6eb43eda04
1 changed files with 14 additions and 1 deletions

View File

@ -1,3 +1,10 @@
/**
*
one of the standard Brute force is O(n^2),but this is optimized version of this question
time complexity of inserting all element in Trie of array is O(31*n).
time complexity of finding Xor of each element in Trie of given array is O(31*n).
so the complexity is O(31*n);
*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
@ -143,3 +150,9 @@ int main()
}
cout << mx;
}
/**
sample input
a = [1,2,3]
output
3 (i.e. (2^1))
*/