JavaScript and Rust solution
Intuition\nWe need to find first number which is power of 2 and not presented in the array. If we have 1 and 2 we can build 3. If we have 1 2 and 4 we can build
# Intuition\nWe need to find first number which is power of 2 and not presented in the array. If we have 1 and 2 we can build 3. If we have 1 2 and 4 we can build 3, 5, 6 and 7 etc. \n\n# Approach\nMove all the numbers from array into set. Iterate powers of 2 unitill first not presented in the array.\n\n# Complexity\n- Time complexity:\nO(N)\n\n- Space complexity:\nO(N)\n\n# Code\n**JavaScript**\n```\n/**\n * @param {number[]} nums\n * @return {number}\n */\nvar minImpossibleOR = function(nums) {\n    let set = new Set()\n    for(let i = 0; i < nums.length; i++){\n        set.add(nums[i])\n    }\n    \n    for (let i = 0; i <= 32; i++){\n        let num = Math.pow(2, i)\n        if(!set.has(num)){\n            return num\n        }\n    }\n    \n};\n```\n**Rust**\n```\nimpl Solution {\n    pub fn min_impossible_or(nums: Vec<i32>) -> i32 {\n        let mut set = std::collections::HashSet::new();\n        for num in nums.iter() {\n            set.insert(num);\n        }\n        \n        for n in 0..=32 {\n            let num:i32 = 2i32.pow(n);\n            if(!set.contains(&num)){\n                return num;\n            }\n        }\n        return -1;\n    }\n}\n```\n
['Rust', 'JavaScript']