You are given an integer array nums of length n, and two integers k and m.
In one operation, you can choose any element in nums and increment its value by k operations in total across all elements.
Your goal is to select a subset of m elements from nums such that after performing at most k operations, the bitwise AND of the selected m elements is maximized.
Return the maximum possible bitwise AND of the chosen m elements.
Constraints:
nums.length
nums[i]
k
m
You are given an integer array nums of length n, and two integers k and m.
In one operation, you can choose any element in nums and increment its value by k operations in total across all elements.
Your goal is to select a subset of m elements from nums such that after performing at most k operations, the bitwise AND of the selected m elements is maximized.
Return the maximum possible bitwise AND of the chosen m elements.
Constraints:
nums.length
nums[i]
k
m