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 e6daee8 commit 118ea31Copy full SHA for 118ea31
src/main/java/g0401_0500/s0416_partition_equal_subset_sum/Solution.java
@@ -17,9 +17,6 @@ public boolean canPartition(int[] nums) {
17
int[] arr = new int[sum + 2];
18
int top = 0;
19
for (int val : nums) {
20
- if (val == sum) {
21
- return true;
22
- }
23
for (int i = top; i > -1; i--) {
24
int tempSum = val + arr[i];
25
if (tempSum <= sum && !set[tempSum]) {
0 commit comments