We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 26f3bf3 commit baa0459Copy full SHA for baa0459
src/main/java/g0401_0500/s0416_partition_equal_subset_sum/Solution.java
@@ -25,9 +25,7 @@ public boolean canPartition(int[] nums) {
25
}
26
for (int i = top; i > -1; i--) {
27
int tempSum = val + arr[i];
28
- if (tempSum > sum || set[tempSum]) {
29
- continue;
30
- } else {
+ if (tempSum <= sum && !set[tempSum]) {
31
if (tempSum == sum) {
32
return true;
33
0 commit comments