Problem statement

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

Solution

Just use counter here.

Complexity

It is O(n) for time and space.

Code

class Solution:
    def solve(self, nums):
        return any(x == y for x, y in Counter(nums).items())