less than 1 minute read

Given a list of integers nums, return whether there’s an integer whose frequency in the list is same as its value.

Constraints

  • n ≤ 100,000 where n is the length of nums

https://binarysearch.com/problems/Equivalent-Value-and-Frequency

Examples

Example 1

Input

  • nums = [7, 9, 3, 3, 3]

Output

  • answer = True

Explanation

The number 3 appears 3 times.

Solution

Leave a comment