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

Commitfd3a747

Browse files
[LEET-848] update 828
1 parent0605e0c commitfd3a747

File tree

3 files changed

+24
-2
lines changed

3 files changed

+24
-2
lines changed

‎src/main/java/com/fishercoder/solutions/firstthousand/_848.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
publicclass_848 {
44
publicstaticclassSolution1 {
55
publicStringshiftingLetters(Strings,int[]shifts) {
6-
long[]preSums =
7-
newlong[shifts.length];// use long type to avoid integer addition overflow
6+
long[]preSums =newlong[shifts.length];// use long type to avoid integer addition overflow
87
for (inti =shifts.length -1;i >=0;i--) {
98
if (i <shifts.length -1) {
109
preSums[i] =preSums[i +1] +shifts[i];
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
packagecom.fishercoder.solutions.fourththousand;publicclass_3304 {
2+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
packagecom.fishercoder.fourththousand;
2+
3+
importstaticorg.junit.jupiter.api.Assertions.assertEquals;
4+
5+
importcom.fishercoder.solutions.fourththousand._3185;
6+
importorg.junit.jupiter.api.BeforeEach;
7+
importorg.junit.jupiter.api.Test;
8+
9+
publicclass_3185Test {
10+
private_3185.Solution1solution1;
11+
12+
@BeforeEach
13+
publicvoidsetup() {
14+
solution1 =new_3185.Solution1();
15+
}
16+
17+
@Test
18+
publicvoidtest1() {
19+
assertEquals(2,solution1.countCompleteDayPairs(newint[] {12,12,30,24,24}));
20+
}
21+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp