JS Solution
Intuition\n Describe your first thoughts on how to solve this problem. \nDon\'t forget to use BigInt. That\'s why I didn\'t get it right in the contest.\n# Appr
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nDon\'t forget to use BigInt. That\'s why I didn\'t get it right in the contest.\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)$$ -->\nO(n)\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\nO(n)\n# Code\n```\n/**\n * @param {number[]} nums\n * @param {number} k\n * @return {number}\n */\nvar maximumOr = function(nums, k) {\n   let n = nums.length;\n    let prev = [0n];\n    let post = [0n];\n    for (let i = 0; i < n; i++) prev.push(prev[prev.length - 1] | BigInt(nums[i]))\n    for (let i = n - 1; i >= 0; i--) post.push(post[post.length - 1] | BigInt(nums[i]));\n    let res = 0n;\n    for (let i = 0; i < n; i++) {\n        let cur = BigInt(nums[i]);\n        let v = cur * BigInt(2 ** k) | prev[i] | post[n - i - 1];\n        if (v > res) {\n            res = v;\n        }\n    }\n    return Number(res);\n};\n```
['JavaScript']