Count Unique Elements
Given an integer array nums, return the number of values that occur exactly once. A value occurring two or more times is not unique and contributes nothing to…
Given an integer array `nums`, return the number of values that occur exactly once. A value occurring two or more times is not unique and contributes nothing to the count.
- `1 <= nums.length <= 100` - `-10^9 <= nums[i] <= 10^9` - The interactive visualizer accepts at most 12 values; longer valid arrays are execution-only.
Example 1: input nums = [4,4,2,7,2]; output 1. Only 7 occurs exactly once.
Example 2: input nums = [5,5,5]; output 0. No value occurs exactly once.
Category: Arrays & Hashing. Topic: arrays. Difficulty: Easy. Patterns: hashing.