I am facing problem in problem no. 421 - Maximum XOR of two number by using hashset method can anyone help me?? in explaining problem
Leetcode problem
hi @khushmanglani31217_7de9bf16f9c8f286 have u studied trie?
u need to find 2 no such that is u do xor operation (bitwise) it should be maximum. U can do brute force and use to for loop for finding all pairs and doing xor but with trie it can done in optimal way
refer this https://www.geeksforgeeks.org/maximum-xor-of-two-numbers-in-an-array/
Can you explain me a hashset method
@khushmanglani31217_7de9bf16f9c8f286 can u please elaborate what u wanna do with hashset, i mean algorithm what u r thinking then i can help
I am not able to understand gfg article 2nd solution that you have sent of time complexity O(NlogM) auxiliary space - O(logM) so can you explain me that solution???
hi @khushmanglani31217_7de9bf16f9c8f286 its trying to check bit by bit if that max is achievable is yes its updating the ans please dry run on paper for the example { 25, 10, 2, 8, 5, 3 }
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.