From 6f8f5bebfe29f13eed7293e638c34804fdb724ab Mon Sep 17 00:00:00 2001 From: Hrishikesh Padhye Date: Sun, 2 Aug 2020 11:06:09 +0530 Subject: [PATCH] Update and rename Minimum sum partition to MinimumSumPartition.java Updated the file name and indentations to increase the readability --- DynamicProgramming/Minimum sum partition | 78 --------------------- DynamicProgramming/MinimumSumPartition.java | 73 +++++++++++++++++++ 2 files changed, 73 insertions(+), 78 deletions(-) delete mode 100644 DynamicProgramming/Minimum sum partition create mode 100644 DynamicProgramming/MinimumSumPartition.java diff --git a/DynamicProgramming/Minimum sum partition b/DynamicProgramming/Minimum sum partition deleted file mode 100644 index 3763d5bd..00000000 --- a/DynamicProgramming/Minimum sum partition +++ /dev/null @@ -1,78 +0,0 @@ -// Partition a set into two subsets such that the difference of subset sums is minimum - -/* -Input: arr[] = {1, 6, 11, 5} -Output: 1 -Explanation: -Subset1 = {1, 5, 6}, sum of Subset1 = 12 -Subset2 = {11}, sum of Subset2 = 11 - -Input: arr[] = {36, 7, 46, 40} -Output: 23 -Explanation: -Subset1 = {7, 46} ; sum of Subset1 = 53 -Subset2 = {36, 40} ; sum of Subset2 = 76 - */ - -import java.util.*; -import java.lang.*; -import java.io.*; -class GFG - { - public static void main (String[] args) - { - Scanner sc=new Scanner(System.in); - int t=sc.nextInt(); - while(t-->0) - { - int n=sc.nextInt(); - int arr[]=new int[n]; - int sum=0; - for(int i=0;i0) + { + int n=sc.nextInt(); + int arr[]=new int[n]; + int sum=0; + for(int i=0;i