Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitefd44e5

Browse files
add 3238
1 parente3380d3 commitefd44e5

File tree

2 files changed

+32
-0
lines changed
  • paginated_contents/algorithms/4th_thousand
  • src/main/java/com/fishercoder/solutions/fourththousand

2 files changed

+32
-0
lines changed

‎paginated_contents/algorithms/4th_thousand/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
| # | Title | Solutions | Video | Difficulty | Tag
22
|------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------|------------|----------------------------------------------------------------------
3+
| 3238|[Find the Number of Winning Players](https://leetcode.com/problems/find-the-number-of-winning-players/)|[Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3238.java)|| Easy|
34
| 3237|[Alt and Tab Simulation](https://leetcode.com/problems/alt-and-tab-simulation/)|[Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3237.java)|| Medium|
45
| 3234 |[Count the Number of Substrings With Dominant Ones](https://leetcode.com/problems/count-the-number-of-substrings-with-dominant-ones/) |[Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3234.java) | | Medium | Sliding Window
56
| 3233 |[Find the Count of Numbers Which Are Not Special](https://leetcode.com/problems/find-the-count-of-numbers-which-are-not-special/) |[Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3233.java) | | Medium | Math
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
packagecom.fishercoder.solutions.fourththousand;
2+
3+
importjava.util.HashMap;
4+
importjava.util.Map;
5+
6+
publicclass_3238 {
7+
publicstaticclassSolution1 {
8+
publicintwinningPlayerCount(intn,int[][]pick) {
9+
intwinners =0;
10+
Map<Integer,int[]>map =newHashMap<>();
11+
for (int[]p :pick) {
12+
intplayer =p[0];
13+
intcolor =p[1];
14+
int[]colors =map.getOrDefault(player,newint[11]);
15+
colors[color]++;
16+
map.put(player,colors);
17+
}
18+
for (Map.Entry<Integer,int[]>entry :map.entrySet()) {
19+
intplayer =entry.getKey();
20+
int[]colors =entry.getValue();
21+
for (intc :colors) {
22+
if (c >=player +1) {
23+
winners++;
24+
break;
25+
}
26+
}
27+
}
28+
returnwinners;
29+
}
30+
}
31+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp