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 baa0459 commit 9d04f37Copy full SHA for 9d04f37
src/main/java/g0401_0500/s0416_partition_equal_subset_sum/Solution.java
@@ -1,7 +1,7 @@
1
package g0401_0500.s0416_partition_equal_subset_sum;
2
3
// #Medium #Top_100_Liked_Questions #Array #Dynamic_Programming #Level_2_Day_13_Dynamic_Programming
4
-// #Big_O_Time_O(n*sums)_Space_O(n*sums) #2024_11_17_Time_6_ms_(99.66%)_Space_42.4_MB_(82.95%)
+// #Big_O_Time_O(n*sums)_Space_O(n*sums) #2024_11_17_Time_5_ms_(99.88%)_Space_42.2_MB_(85.79%)
5
6
public class Solution {
7
public boolean canPartition(int[] nums) {
@@ -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 false;
22
- }
23
if (val == sum) {
24
return true;
25
}
0 commit comments