Beats 100.00% | 1-liner
\n\n\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/48529dcf-f5b6-45dd-849b-c733b735ff58_1728996570.5775468.png)\n\n![image.png](https://assets.leetcode.com/users/images/308b2398-a5aa-4ca9-a877-01199024f63f_1729260519.1791146.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', 'JavaScript']