Easy to understand solution in Java. Beats 100 %
ApproachWe initialize a 2D Array to track color counts for each player.
int[][] playerColorCount = new int[n][11];This array tracks the number of times each pla
# Approach
We initialize a 2D Array to track color counts for each player.
int[][] playerColorCount = new int[n][11];

This array tracks the number of times each player has picked each of the 11 colors (colors 0 through 10). The number of rows in this array is equal to the number of players n, and the number of columns is 11 (one for each color).

We update the color counts based on the pick array: the pick array is a list of picks where each entry p is an array of two integers: the player index and the color that the player chose.

For each pick, the corresponding entry in the playerColorCount array is incremented:
playerColorCount[player][color]++
This step updates how many times each player has picked each color.

The second loop iterates through each player (i from 0 to n - 1) and for each player, **we check if any of color counts exceed the player's index i (i.e., if the player picked any color more times than their player index).
If so, the player is counted as a "winning player", and the winnerCount is incremented.** We check using the condition if (color > i) — this checks if the count of any color picked by the player exceeds their index. If the condition is true, the inner loop breaks early because the player is already considered a winner.

After checking all players, the total count of winning players is returned.

# Complexity
- Time complexity:
O(n+m)
*(where n is the number of players and m is the number of picks)*

- Space complexity:
O(n+m)
*(where n is the number of players and m is the number of picks)*

# Code
```java []
class Solution {
    public int winningPlayerCount(int n, int[][] pick) {
        int[][] playerColorCount = new int[n][11];

        for (int[] p : pick) {
            int player = p[0];
            int color = p[1];
            playerColorCount[player][color]++;
        }
        int winnerCount = 0;
        for (int i = 0; i < n; i++) {
            for (int color : playerColorCount[i]) {
                if (color > i) {
                    winnerCount++;
                    break;
                }
            }
        }
        return winnerCount;
    }
}
```
['Java']