You are given a nums and a positive integer k.
In one operation, you can choose two distinct indices i and j such that i, j nums.length, and simultaneously replace nums[i] with (nums[i] AND nums[j]) and nums[j] with (nums[i] OR nums[j]), where AND denotes the bitwise AND operation and OR denotes the bitwise OR operation.
You may apply this operation any number of times.
Return the maximum possible sum of squares of any k elements chosen from the final array. Since the result can be very large, return it modulo
Constraints:
k nums.length
nums[i]
You are given a nums and a positive integer k.
In one operation, you can choose two distinct indices i and j such that i, j nums.length, and simultaneously replace nums[i] with (nums[i] AND nums[j]) and nums[j] with (nums[i] OR nums[j]), where AND denotes the bitwise AND operation and OR denotes the bitwise OR operation.
You may apply this operation any number of times.
Return the maximum possible sum of squares of any k elements chosen from the final array. Since the result can be very large, return it modulo
Constraints:
k nums.length
nums[i]