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

Commit8c80a63

Browse files
[LEET-3304] add 3304
1 parentfd3a747 commit8c80a63

File tree

3 files changed

+28
-8
lines changed
  • paginated_contents/algorithms/4th_thousand
  • src

3 files changed

+28
-8
lines changed

‎paginated_contents/algorithms/4th_thousand/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
| # | Title | Solutions | Video | Difficulty | Tag
22
|------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------|------------|----------------------------------------------------------------------
33
| 3318|[Find X-Sum of All K-Long Subarrays I](https://leetcode.com/problems/find-x-sum-of-all-k-long-subarrays-i/)|[Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3318.java)|| Easy|
4+
| 3304|[Find the K-th Character in String Game I](https://leetcode.com/problems/find-the-k-th-character-in-string-game-i/)|[Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3304.java)|| Easy|
45
| 3285|[Find Indices of Stable Mountains](https://leetcode.com/problems/find-indices-of-stable-mountains/)|[Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3285.java)|| Easy|
56
| 3264|[Final Array State After K Multiplication Operations I](https://leetcode.com/problems/final-array-state-after-k-multiplication-operations-i/)|[Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3264.java)|| Easy|
67
| 3263|[Convert Doubly Linked List to Array I](https://leetcode.com/problems/convert-doubly-linked-list-to-array-i/)|[Java](https://github.com/fishercoder1534/Leetcode/blob/master/src/main/java/com/fishercoder/solutions/fourththousand/_3263.java)|| Easy|
Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,16 @@
1-
packagecom.fishercoder.solutions.fourththousand;publicclass_3304 {
1+
packagecom.fishercoder.solutions.fourththousand;
2+
3+
publicclass_3304 {
4+
publicstaticclassSolution1 {
5+
publiccharkthCharacter(intk) {
6+
StringBuildersb =newStringBuilder("a");
7+
while (sb.length() <=k) {
8+
intn =sb.length();
9+
for (inti =0;i <n;i++) {
10+
sb.append((char) (sb.charAt(i) +1));
11+
}
12+
}
13+
returnsb.charAt(k -1);
14+
}
15+
}
216
}
Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,26 @@
11
packagecom.fishercoder.fourththousand;
22

3-
importstaticorg.junit.jupiter.api.Assertions.assertEquals;
4-
5-
importcom.fishercoder.solutions.fourththousand._3185;
3+
importcom.fishercoder.solutions.fourththousand._3304;
64
importorg.junit.jupiter.api.BeforeEach;
75
importorg.junit.jupiter.api.Test;
86

9-
publicclass_3185Test {
10-
private_3185.Solution1solution1;
7+
importstaticorg.junit.jupiter.api.Assertions.assertEquals;
8+
9+
publicclass_3304Test {
10+
private_3304.Solution1solution1;
1111

1212
@BeforeEach
1313
publicvoidsetup() {
14-
solution1 =new_3185.Solution1();
14+
solution1 =new_3304.Solution1();
1515
}
1616

1717
@Test
1818
publicvoidtest1() {
19-
assertEquals(2,solution1.countCompleteDayPairs(newint[] {12,12,30,24,24}));
19+
assertEquals('b',solution1.kthCharacter(5));
20+
}
21+
22+
@Test
23+
publicvoidtest2() {
24+
assertEquals('h',solution1.kthCharacter(128));
2025
}
2126
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp