Given an integer array nums and an integer k, you may repeatedly choose two distinct elements from nums whose sum equals k and remove both elements from the array. Each such removal counts as one operation.
Return the maximum number of operations you can perform.
Constraints:
nums.length
nums[i]
k
Given an integer array nums and an integer k, you may repeatedly choose two distinct elements from nums whose sum equals k and remove both elements from the array. Each such removal counts as one operation.
Return the maximum number of operations you can perform.
Constraints:
nums.length
nums[i]
k