Beats 100.00% on time & 100.00% on memory | 1-liner
\n\ntypescript []\nfunction minBitwiseArray(nums: number[]): number[] {\n  return nums.map((num) => (num === 2 ? -1 : (((-num - 2) ^ num) >> 2) + num))\n}\n
![image.png](https://assets.leetcode.com/users/images/b82507aa-3ad6-4d0c-8c30-775d705b76da_1728996750.994921.png)\n\n```typescript []\nfunction minBitwiseArray(nums: number[]): number[] {\n  return nums.map((num) => (num === 2 ? -1 : (((-num - 2) ^ num) >> 2) + num))\n}\n```
['TypeScript']