File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
main/java/com/fishercoder/solutions/firstthousand
test/java/com/fishercoder/fourththousand Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change 33public class _848 {
44 public static class Solution1 {
55 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
78 for (int i = shifts .length - 1 ; i >= 0 ; i --) {
89 if (i < shifts .length - 1 ) {
910 preSums [i ] = preSums [i + 1 ] + shifts [i ];
Original file line number Diff line number Diff line change 11package com .fishercoder .fourththousand ;
22
3+ import static org .junit .jupiter .api .Assertions .assertEquals ;
4+
35import com .fishercoder .solutions .fourththousand ._3304 ;
46import org .junit .jupiter .api .BeforeEach ;
57import org .junit .jupiter .api .Test ;
68
7- import static org .junit .jupiter .api .Assertions .assertEquals ;
8-
99public class _3304Test {
1010 private _3304 .Solution1 solution1 ;
1111
You can’t perform that action at this time.
0 commit comments