brute force
\nrust []\nfn f(x: i32) -> i32 {\n    for y in 1..x  {\n        if (y | (y+1)) as i32 == x {return y}\n    }\n    -1\n}\nimpl Solution {\n    pub fn min_bitwise
\n```rust []\nfn f(x: i32) -> i32 {\n    for y in 1..x  {\n        if (y | (y+1)) as i32 == x {return y}\n    }\n    -1\n}\nimpl Solution {\n    pub fn min_bitwise_array(nums: Vec<i32>) -> Vec<i32> {\n        nums.into_iter().map(f).collect()\n    }\n}\n```
['Rust']