Given a set of integers (range 0-500), find the minimum difference between the sum of two subsets that can be formed by splitting them almost equally. The minimum path sum from top to bottom is 11 (i.e., 2 + 3 + 5 + 1 = 11). Minimum Cost to Fill Bag. Minimum Time Difference (Medium) 541. Add Two Numbers (Medium) 3. Count of SubSet Sum. LeetCode 1681 minimum incompatibility. Given a set of non- negative integers, and a value sum, determine if there is a subset of the given set Auxiliary Space: O(sum*n), as the size of 2-D array is sum*n. Now take the two subsets from above step which gives minimum difference – dvsakgec Mar 17 '19 at 19:13 Coin Changing Problem 2(Minimum no of coins). Note: Bonus point if you are able to do this using only O ( n ) extra space, where n is the total number of rows in the triangle. Sort the array 3. Subset sum problem. Minimum SubSet Sum Difference. This is similar to the problem "Minimum Subset Difference" i.e. Last Updated: 25-08-2020. Minimum Time Difference (Medium) 541. Return the minimum possible sum of incompatibilities of the k subsets after distributing the array optimally, or return -1 if it is not possible. Split array into minimum number of subsets such that elements of all pairs are present in different subsets at least once 04, Jan 21 Minimum removal of subsequences of distinct consecutive characters required to empty a given string The incompatibility of a subset is the difference between the maximum value and the minimum value in the subset. Reverse String II (Easy) 542. Parent Problem: Longest Common SubSequence SubProblems : Subset sum problem, Subset Sum Problem | DP-25. Rod Cutting Problem. Start from last and keep adding till total sum is just less than or just greater than expected subset sum calculated earlier. Example 1: Reverse String II (Easy) 542. (say count of integers is n, if n is even, each set must have n/2 elements and if n is odd, one set has (n-1)/2 elements and other has (n+1)/2 elements) 4. Subset Sum Sweep-line Algorithm ... LeetCode LeetCode Diary 1. You may assume that each input would have exactly one solution , and you may not use the same element twice. NOTE: sum(S1) = sum of all elements in subset S1 Title Link. Two Sum Given an array of integers nums and an integer target , return indices of the two numbers such that they add up to target . SubSet Sum. Two Sum (Easy) 2. Split the array into two subsets (S1, S2), such that absolute difference between sum(S1) and sum(S2) is minimum. Expected subset sum = sum_of_all_elements/2 2. Two Sum (Easy) 2. A subset’s incompatibility is the difference between the maximum and minimum elements in that array. Add Two Numbers (Medium) 3. A subset is a group integers that appear in the array with no particular order. Subset Sum Sweep-line Algorithm ... LeetCode LeetCode Diary 1. I give you an integer array nums and an integer K. You need to divide the array into k subsets of the same size so that there are no two identical elements in the same subset. Count SubSets of given Sum. Parent Problem: Unbounded KnapSack SubProblems : Coin Changing Problem 1(No of ways). Equal Sum Partition.