Skip to content

Commit baa0459

Browse files
committed
Update Solution.java
1 parent 26f3bf3 commit baa0459

File tree

1 file changed

+1
-3
lines changed
  • src/main/java/g0401_0500/s0416_partition_equal_subset_sum

1 file changed

+1
-3
lines changed

src/main/java/g0401_0500/s0416_partition_equal_subset_sum/Solution.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ public boolean canPartition(int[] nums) {
2525
}
2626
for (int i = top; i > -1; i--) {
2727
int tempSum = val + arr[i];
28-
if (tempSum > sum || set[tempSum]) {
29-
continue;
30-
} else {
28+
if (tempSum <= sum && !set[tempSum]) {
3129
if (tempSum == sum) {
3230
return true;
3331
}

0 commit comments

Comments
 (0)