Construct Min Bitwise Array I

Given an array nums, for each element target find the smallest non-negative integer i such that i | target == target. If no such i exists, return -1 for that position. The answer is target with its least significant set bit cleared, or -1 when target is 0.

Examples
Input: [5,3,2]
Output: [4,2,0]
Hints

Construct Min Bitwise Array I

Given an array nums, for each element target find the smallest non-negative integer i such that i | target == target. If no such i exists, return -1 for that position. The answer is target with its least significant set bit cleared, or -1 when target is 0.