3238. Find the Number of Winning Players
You are given an integer
nrepresenting the number of players in a game and a 2D arraypickwherepick[i] = [xi, yi]represents that the playerxipicked a ball of coloryi.Player
iwins the game if they pick strictly more thaniballs of the same color. In other words,
- Player 0 wins if they pick any ball.
- Player 1 wins if they pick at least two balls of the same color.
- …
- Player
iwins if they pick at leasti + 1balls of the same color.Return the number of players who win the game.
Note that multiple players can win the game.
1 | class Solution { |