Problem statement

https://binarysearch.com/problems/Detect-Voter-Fraud/

Solution

Just count that all second elements are unique, using set.

Complexity

It is O(n) for time and space.

Code

class Solution:
    def solve(self, votes):
        X = [i for _, i in votes]
        return len(X) != len(set(X))