Skip to content

Commit 3e727e3

Browse files
Update DynamicProgramming/MinimumSumPartition.java
Co-authored-by: Du Yuanchao <[email protected]>
1 parent 86d6e93 commit 3e727e3

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

DynamicProgramming/MinimumSumPartition.java

+7-8
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,12 @@ public static int getMin(int[] arr, int sum) {
8181
return min;
8282
}
8383

84-
public static void main(String args[]){
85-
Scanner in = new Scanner(System.in);
86-
int n = in.nextInt();
87-
int arr[] = new int[n];
88-
for(int i = 0 ; i<n; i++){
89-
arr[i] = in.nextInt();
90-
}
91-
System.out.println(subSet(arr));
84+
/**
85+
* Driver Code
86+
*/
87+
public static void main(String[] args) {
88+
assert subSet(new int[]{1, 6, 11,5}) == 1;
89+
assert subSet(new int[]{36, 7, 46, 40}) == 23;
90+
assert subSet(new int[]{1, 2, 3, 9}) == 3;
9291
}
9392
}

0 commit comments

Comments
 (0)