values and an integer doublings. In one operation you pick any element and multiply it by 2; you may do at most doublings operations in total.
Return the largest possible bitwise OR of all elements after the operations.values=[5, 3], doublings=1 → 11
Doubling 5 gives 10 | 3 = 11. Doubling 3 is worse: 5 | 6 = 7.
values=[1, 4, 2], doublings=3 → 35
All three doublings go to 4: 32 | 1 | 2 = 35.
values=[5, 3], doublings=1
11
Run checks the first 3 tests in your browser. Submit checks all 113 tests on the server, hidden ones included.