Java Declarative Solution
Code\njava []\nclass Solution {\n\n  public Map<Integer, List<Integer>> parseGame(int[][] pick) {\n    return Arrays.stream(pick)\n      .collect(\n        Coll
# Code\n```java []\nclass Solution {\n\n  public Map<Integer, List<Integer>> parseGame(int[][] pick) {\n    return Arrays.stream(pick)\n      .collect(\n        Collectors.groupingBy(\n          it -> it[0],\n          Collectors.mapping(\n            it -> it[1], \n            Collectors.toList()\n          )\n        )\n      );\n  }\n\n  public boolean isWinner(\n      Integer playerIndex, Map<Integer, List<Integer>> game) {\n    return Optional.ofNullable(game.get(playerIndex))\n      .orElse(List.of())\n      .stream()\n      .collect(\n        Collectors.groupingBy(\n          Function.identity(),\n          Collectors.counting()\n        )\n      )\n      .entrySet().stream()\n      .filter(e -> e.getValue() > playerIndex)\n      .findFirst()\n      .isPresent();\n  }\n\n  public int winningPlayerCount(int n, int[][] pick) {\n    var game = parseGame(pick);\n    return (int) IntStream.range(0, n)\n      .filter(it -> isWinner(it, game))\n      .count();\n  }\n}\n```
['Java']