← ALL NOTES
Array

3314. Construct the Minimum Bitwise Array I

Given an array nums. Build an array ans of the same length where ans[i] | (ans[i]+1) == nums[i], with ans[i] minimized; if no such ans[i] exists, return −1 at that position.

Loading…