Counting Winning Players Based on Ball Colors in a Game
IntuitionTo solve this problem, we need to keep track of the number of balls of each color picked by each player. Then, we need to check if each player has pick
# Intuition
To solve this problem, we need to keep track of the number of balls of each color picked by each player. Then, we need to check if each player has picked more balls of a particular color than their player index.

# Approach
1. Use a vector of HashMaps to store the count of balls of each color picked by each player.
2. Iterate over the `pick` array to populate the counts.
3. Check each player to see if they picked more balls of the same color than their player index.
4. Count the number of players who meet the criteria.

# Complexity
- Time complexity: $$O(p \cdot n)$$ where `p` is the length of the `pick` array and `n` is the number of players. In the worst case, we need to iterate through the entire `pick` array and process each entry, and then iterate through the counts for each player.
- Space complexity: $$O(n \cdot c)$$ where `n` is the number of players and `c` is the number of different colors. We need a separate HashMap to store the counts for each player.

# Code
```rust []
use std::collections::HashMap;

impl Solution {
    pub fn winning_player_count(n: i32, pick: Vec<Vec<i32>>) -> i32 {
        let mut counts:Vec<HashMap<_,_>>=vec![HashMap::with_capacity(n as usize);n as usize];
        pick.iter().for_each(|f|{
            *counts[f[0] as usize].entry(f[1]).or_insert(0)+=1;
        });
        
        counts.iter().enumerate().filter(|(i,c)|{
            c.values().any(|&c|c>*i)
        }).count() as i32
    }
}
```
['Array', 'Hash Table', 'Counting', 'Rust']