maximum
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nconst maximumOr = (nums, k) => {\n    // O(n) - determine bits that appear in multiple numbers and those\n    // that appear in any number\n    let appearsInMultiple = 0n, appearsInAny = 0n\n    for (let num of nums) {\n        appearsInMultiple |= appearsInAny & BigInt(num)\n        appearsInAny |= BigInt(num)\n    }\n\n    // O(n) - determine maximum number we can form by taking\n    // bits that appear in multiple numbers, bits that appear\n    // in any number that don\'t appear in current num, and bits\n    // we get from LSH of current num by k\n    let maximum = appearsInAny\n    for (let num of nums) {\n        const n = appearsInMultiple | appearsInAny & ~BigInt(num) | BigInt(num) << BigInt(k)\n        if (n > maximum) {\n            maximum = n\n        }\n    }\n\n    return Number(maximum)\n}\n```
['JavaScript']