← All problemsSign in

3843. First Element with Unique Frequency

LeetCodeArrayHash TableCountingOpen on judge ↗

You are given an integer array nums. Return an integer denoting the first element (scanning from left to right) in nums whose frequency is unique. That is, no other integer appears the same number of times in nums. If there is no such element, return -1. Example 1: Input: nums = [20,10,30,30] Output: 30 Explanation: - 20 appears once. - 10 appears once. - 30 appears twice. - The frequen

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start