#3315

Construct the Minimum Bitwise Array II

specialist · 620 · lc medium +29 · 66.5% accepted · 354 likes · top 72%

Description

You are given array nums of prime integers. For each element, find the minimum non-negative ans[i] satisfying ans[i] OR (ans[i] + 1) == nums[i], or -1 if impossible. Return the resulting array.

Code

1
2
3