Rust cheapest & best
\nuse std::collections::HashSet;\nuse std::iter::FromIterator;\n\nimpl Solution {\n    pub fn find_maximum_xor(nums: Vec<i32>) -> i32 {\n        (0..=31)\n     
```\nuse std::collections::HashSet;\nuse std::iter::FromIterator;\n\nimpl Solution {\n    pub fn find_maximum_xor(nums: Vec<i32>) -> i32 {\n        (0..=31)\n            .rev()\n            .scan(0, |mask, i| {\n                *mask = *mask | 1 << i;\n                Some((*mask, 1 << i))\n            })\n            .fold(0, |result, (mask, bit)| {\n                let greedy = result | bit;\n                let s: HashSet<i32> = HashSet::from_iter(nums.iter().map(|n| n & mask));\n                s.iter()\n                    .find(|&left_part| s.contains(&(left_part ^ greedy)))\n                    .map(|_| greedy)\n                    .unwrap_or(result)\n            })\n    }\n}\n```
[]