A subset is a group integers that appear in the array with no particular order. Add Two Numbers (Medium) 3. Reverse String II (Easy) 542. Subset Sum Sweep-line Algorithm ... LeetCode LeetCode Diary 1. Subset sum problem. Minimum SubSet Sum Difference. A subset’s incompatibility is the difference between the maximum and minimum elements in that array. Parent Problem: Unbounded KnapSack SubProblems : Coin Changing Problem 1(No of ways). 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 . Add Two Numbers (Medium) 3. Now take the two subsets from above step which gives minimum difference – dvsakgec Mar 17 '19 at 19:13 Sort the array 3. The incompatibility of a subset is the difference between the maximum value and the minimum value in the subset. Coin Changing Problem 2(Minimum no of coins). Subset sum problem, Subset Sum Problem | DP-25. NOTE: sum(S1) = sum of all elements in subset S1 Two Sum (Easy) 2. Minimum Cost to Fill Bag. This is similar to the problem "Minimum Subset Difference" i.e. Expected subset sum = sum_of_all_elements/2 2. You may assume that each input would have exactly one solution , and you may not use the same element twice. SubSet Sum. 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. Split the array into two subsets (S1, S2), such that absolute difference between sum(S1) and sum(S2) is minimum. Example 1: Count of SubSet Sum. Parent Problem: Longest Common SubSequence SubProblems : 4. Start from last and keep adding till total sum is just less than or just greater than expected subset sum calculated earlier. 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. The minimum path sum from top to bottom is 11 (i.e., 2 + 3 + 5 + 1 = 11). Minimum Time Difference (Medium) 541. 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. 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. (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) Rod Cutting Problem. Subset Sum Sweep-line Algorithm ... LeetCode LeetCode Diary 1. Title Link. Return the minimum possible sum of incompatibilities of the k subsets after distributing the array optimally, or return -1 if it is not possible. Equal Sum Partition. LeetCode 1681 minimum incompatibility. Two Sum (Easy) 2. Reverse String II (Easy) 542. Last Updated: 25-08-2020. Minimum Time Difference (Medium) 541. 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