Max Number of K-Sum Pairs

Medium · Hashing · about 15 minutes

Asked at Google, Amazon, Meta, Microsoft.

In one operation, remove two numbers from nums whose sum equals k. Return the maximum number of operations.

Related guides