message: Update max-number-of-k-sum-pairs.cpp
diff: @@ -5,19 +5,14 @@ class Solution {
  public:
  int maxOperations(vector<int>& nums, int k) {
  unordered_map<int, int> lookup;
  + int result = 0;
  for (const auto& num : nums) {
  + if (lookup.count(k - num) && lookup[k - num]) {
  + --lookup[k - num];
  + ++result;
  + } else {
  ++lookup[num];
  }
  - int result = 0;
  - for (const auto& [num, cnt] : lookup) {
  - if (k - num == num) {
  - result += cnt / 2;
  - } else if (lookup.count(k - num)) {
  - int c = min(cnt, lookup[k - num]);
  - result += c;
  - lookup[num] -= c;
  - lookup[k - num] -= c;
  - }
  }
  return result;
  }
  