Skip to content

Commit 05c23fb

Browse files
committed
Fixed sonar
1 parent be181b3 commit 05c23fb

File tree

1 file changed

+2
-1
lines changed
  • src/main/java/g3201_3300/s3245_alternating_groups_iii

1 file changed

+2
-1
lines changed

src/main/java/g3201_3300/s3245_alternating_groups_iii/Solution.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ private void update(BitSet set, BIT bit, int n, int i, int v) {
8686
}
8787

8888
private int getIndex(int index, int mod) {
89-
return index < 0 ? index + mod : index >= mod ? index - mod : index;
89+
int result = index >= mod ? index - mod : index;
90+
return index < 0 ? index + mod : result;
9091
}
9192

9293
private static class BIT {

0 commit comments

Comments
 (0)