[C] Greedy
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: $$O(n)$$ \n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: $$O(n)$$ \n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\n/*\n * 2680. Maximum OR\n *\n * You are given a 0-indexed integer array nums of length n and an integer k. \n * In an operation, you can choose an element and multiply it by 2.\n * \n * Return the maximum possible value of nums[0] | nums[1] | ... | nums[n - 1] \n * that can be obtained after applying the operation on nums at most k times.\n * \n * Note that a | b denotes the bitwise or between two integers a and b.\n *\n * 1 <= nums.length <= 10^5\n * 1 <= nums[i] <= 10^9\n * 1 <= k <= 15\n */\n\nlong long maximumOr(int* nums, int numsSize, int k){\n\n    /*\n     * Input:\n     *  *nums\n     *  numsSize\n     *  k\n     */\n\n    int *prefix = (int *)malloc(sizeof(int) * numsSize);\n    int *suffix = (int *)malloc(sizeof(int) * numsSize);\n    long long tmp, ans = 0;\n\n    /* Generate prefix and suffix OR */\n    prefix[0] = nums[0];\n    suffix[numsSize - 1] = nums[numsSize - 1];\n    for (int i = 1; i < numsSize; i++) {\n        prefix[i] = prefix[i - 1] | nums[i];\n        suffix[numsSize - 1 - i] = suffix[numsSize - i] | nums[numsSize - 1 - i];\n    }\n\n    for (int i = 0; i < numsSize; i++) {\n\n        /* Calculate nums[i] * 2^k */\n        tmp = ((long long)nums[i]) << k;\n\n        /* OR all the nums[x] on the left */\n        if (i != 0) {\n            tmp |= prefix[i - 1];\n        }\n\n        /* OR all the nums[x] on the right */\n        if (i != numsSize - 1) {\n            tmp |= suffix[i + 1];\n        }\n\n        if (tmp > ans) {\n            ans = tmp;\n        }\n    }\n\n    free(prefix);\n    free(suffix);\n\n    /*\n     * Output:\n     *  Return the maximum possible value of nums[0] | nums[1] | ... | nums[n - 1] \n     *  that can be obtained after applying the operation on nums at most k times.\n     */\n\n    return ans;\n}\n```
['Array', 'Greedy', 'Bit Manipulation', 'C', 'Prefix Sum']