← ALL NOTES
LeetCode

3315. Construct the Minimum Bitwise Array II

Same as version I (ans[i] | (ans[i]+1) == nums[i], minimal ans[i], else −1), but constraints are large — you need an O(1) bit trick instead of enumeration.

Loading…