C Solution
Intuition\n Describe your first thoughts on how to solve this problem. \nNeed to clarify the question.\n\nThis problem is looking for a same size array with new
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nNeed to clarify the question.\n\nThis problem is looking for a same size array with new values that is\ngiven[i] = A, result[i] = B\nwhere,\nA = (B | B + 1)\nwe find individual \'B\' for each given.\nHere is a image showing A(orange) and B(green).\n![image.png](https://assets.leetcode.com/users/images/73cc24e3-d676-4bc6-bcda-36ada92e1176_1729886183.534224.png)\n\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\nOnly question is deciding what values to use for loop length.\nAs seen for example:\nLowest Value we can use is right shifted once.\n"given[j] >> 1"\ngiven[j] = 7 | 0111\nresult[j] = 3 | 0011\n\nMy initial loop used:\nfor (int j = nums[i]; j >= nums[i] / 2; j--)\n\nLater was updated to:\nfor (int j = nums[i] / 2; j <= nums[i]; j++)\n\nDifference is j++ can use a break for the first answer it finds, where j-- will need to always evaluate entire loop.\n\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```c []\n/**\n * Note: The returned array must be malloced, assume caller calls free().\n */\nint* minBitwiseArray(int* nums, int numsSize, int* returnSize) {\n\n    returnSize[0] = numsSize;\n    int* ans = malloc(numsSize * sizeof(int));\n\n    for (int i = 0; i < numsSize; i++) {\n        ans[i] = -1; \n        for (int j = nums[i] / 2; j <= nums[i]; j++) {\n            if ((j | j + 1) == nums[i]) {\n                ans[i] = j;\n                break;\n            }\n        }\n    }\n    return ans;\n}\n\n```
['C']