Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit b4ce579

Browse files
add 2351
1 parent b0baf71 commit b4ce579

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ _If you like this project, please leave me a star._ ★
88

99
| # | Title | Solutions | Video | Difficulty | Tag
1010
|------|----------------|------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------|----------------------------------|-------------
11+
| 2351 |[First Letter to Appear Twice](https://leetcode.com/problems/first-letter-to-appear-twice/)| [Java](../master/src/main/java/com/fishercoder/solutions/_2351.java) || Easy ||
1112
| 2347 |[Maximum Number of Pairs in Array](https://leetcode.com/problems/best-poker-hand/)| [Java](../master/src/main/java/com/fishercoder/solutions/_2347.java) || Easy ||
1213
| 2341 |[Maximum Number of Pairs in Array](https://leetcode.com/problems/maximum-number-of-pairs-in-array/)| [Java](../master/src/main/java/com/fishercoder/solutions/_2341.java) || Easy ||
1314
| 2335 |[Minimum Amount of Time to Fill Cups](https://leetcode.com/problems/minimum-amount-of-time-to-fill-cups/)| [Java](../master/src/main/java/com/fishercoder/solutions/_2335.java) || Easy ||
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package com.fishercoder.solutions;
2+
3+
import java.util.HashSet;
4+
import java.util.Set;
5+
6+
public class _2351 {
7+
public static class Solution1 {
8+
public char repeatedCharacter(String s) {
9+
Set<Character> set = new HashSet<>();
10+
for (char c : s.toCharArray()) {
11+
if (!set.add(c)) {
12+
return c;
13+
}
14+
}
15+
return ' ';
16+
}
17+
}
18+
}

0 commit comments

Comments
 (0)