Easy to Understand
IntuitionApproachComplexity
Time complexity: O(n + m), where n is the number of players and m is the size of the pick vector.

Space complexity: O(n), where n i
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity: O(n + m), where n is the number of players and m is the size of the pick vector.
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity: O(n), where n is the number of players (since we store up to n * 11 player-color combinations in the counts map).
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```cpp []
class Solution {
public:
    int winningPlayerCount(int n, vector<vector<int>>& pick) {
        unordered_map<int, unordered_map<int, int>> counts;  // player -> (color -> count)
        int ans = 0;

        // Build counts map for each player-color combination
        for (int i = 0; i < pick.size(); i++) {
            int player = pick[i][0];
            int color = pick[i][1];
            counts[player][color]++;
        }

        // Now check for each player if they win
        for (int i = 0; i < n; i++) {
            bool found = false;
            for (const auto& colorCount : counts[i]) {
                if (colorCount.second > i) {
                    ans++;
                    found = true;
                    break;
                }
            }
            // Only count the player once if we found a winning color
            if (found) continue;
        }
        return ans;
    }
};
```
['C++']