C Solution || Beats 99.12%
c []\n/**\n * Note: The returned array must be malloced, assume caller calls free().\n */\nint* minBitwiseArray(int* nums, int numsSize, int* returnSize) {\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    int *result = calloc(numsSize, sizeof(int));\n    *returnSize = numsSize;\n\n    memset(result, -1, numsSize * sizeof(int));\n\n    for (int i = 0; i < numsSize; i++) {\n        for (int val = 0; val <= nums[i]; val++) {\n            if ((val | (val + 1)) == nums[i]) {\n                result[i] = val;\n                break;\n            }\n        }\n    }\n\n    return result;\n}\n```
['Array', 'Bit Manipulation', 'C']