Swift💯
Optimized Brute Force Search (accepted answer)\nOR-ing by (n+1) will never yield an even result, so if n is even (n&1==1), return -1. Otherwise brute force sear
**Optimized Brute Force Search (accepted answer)**\nOR-ing by (n+1) will never yield an even result, so if `n` is even (`n&1==1`), return -1. Otherwise brute force search from `n/2` on to find the smallest possible result. \n```\nclass Solution {\n    func minBitwiseArray(_ nums: [Int]) -> [Int] {\n       nums.map{ n in \n            n&1 == 1 ? ((n/2)...).first{i in i|(i+1)==n}! : -1\n        }\n    }\n}\n```
['Swift']