Skip to content

Commit e02790c

Browse files
committed
Fixed sonar
1 parent ec63b96 commit e02790c

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/main/java/g3401_3500/s3457_eat_pizzas/Solution.java

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,14 @@ public long maxWeight(int[] pizzas) {
1616
int n = m / 4;
1717
int index = 0;
1818
for (int x = max; x > 0; --x) {
19-
if (count[x] == 0) {
20-
continue;
21-
}
22-
int c = count[x];
23-
while (c-- > 0) {
24-
pizzas[index++] = x;
25-
}
26-
if (index >= m / 2) {
27-
break;
19+
if (count[x] != 0) {
20+
int c = count[x];
21+
while (c-- > 0) {
22+
pizzas[index++] = x;
23+
}
24+
if (index >= m / 2) {
25+
break;
26+
}
2827
}
2928
}
3029
long ans = 0;

0 commit comments

Comments
 (0)