Leetcode 1679: Max Number of K-Sum Pairs

In this Leetcode problem, we are given an array nums of integers. In one operation, we can take any pair of integers adding up to k and take it out of the array. We want to know the maximum number of operations that we can do following that rule.

For any number num in nums, it can only be paired with k — numfor the sum to be equal tok. Then, for any number 1 ≤ p ≤ k — 1, if we have the value p