File tree 2 files changed +4
-3
lines changed
main/java/com/fishercoder/solutions/firstthousand
test/java/com/fishercoder/fourththousand
2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change 3
3
public class _848 {
4
4
public static class Solution1 {
5
5
public String shiftingLetters (String s , int [] shifts ) {
6
- long [] preSums = new long [shifts .length ]; // use long type to avoid integer addition overflow
6
+ long [] preSums =
7
+ new long [shifts .length ]; // use long type to avoid integer addition overflow
7
8
for (int i = shifts .length - 1 ; i >= 0 ; i --) {
8
9
if (i < shifts .length - 1 ) {
9
10
preSums [i ] = preSums [i + 1 ] + shifts [i ];
Original file line number Diff line number Diff line change 1
1
package com .fishercoder .fourththousand ;
2
2
3
+ import static org .junit .jupiter .api .Assertions .assertEquals ;
4
+
3
5
import com .fishercoder .solutions .fourththousand ._3304 ;
4
6
import org .junit .jupiter .api .BeforeEach ;
5
7
import org .junit .jupiter .api .Test ;
6
8
7
- import static org .junit .jupiter .api .Assertions .assertEquals ;
8
-
9
9
public class _3304Test {
10
10
private _3304 .Solution1 solution1 ;
11
11
You can’t perform that action at this time.
0 commit comments