Divide Array Into Equal Pairs

Given a non-empty integer array nums, determine whether every element can be placed in exactly one pair whose two values are equal. Return true when such a…

Given a non-empty integer array `nums`, determine whether every element can be placed in exactly one pair whose two values are equal. Return `true` when such a partition exists, otherwise `false`.

- `1 <= nums.length <= 10^5` - `-10^9 <= nums[i] <= 10^9` - The interactive visualizer accepts at most 12 values; longer valid arrays are execution-only.

Example 1: input nums = [3, 2, 3, 2, 2, 2]; output true. The values form one pair of 3s and two pairs of 2s.

Example 2: input nums = [1, 2, 3, 4]; output false. Every value is left without an equal partner.

Category: Arrays & Hashing. Topic: arrays. Difficulty: Easy. Patterns: hashing.