# subset

### Count of index subsets such that maximum of values over these indices in A is at least total sum over B

#include using namespace std;  int countValidSubsets(int A[], int B[], int N){    int ans = 0;      vector AB(N);              int mx = INT_MIN;                  for (int i =…

### Split array into minimum number of subsets having difference between maximum and minimum element at most K

Given an array arr[] consisting of N integers and an integer K, the task is to find the minimum number…

### Sum of all subsets of a given size

Given an array arr[] consisting of N integers and a positive integer K, the task is to find the sum…

### Maximum possible difference of two subsets of an array | Set 2

#include using namespace std;  int maxSumAfterPartition(int arr[], int n){        vector pos;          vector neg;          int zero = 0;          int pos_sum = 0;          int neg_sum = 0;          for (int…

### Split array into maximum possible subsets having product of their length with the maximum element at least K

Given an array arr[] consisting of N integers and a positive integer K, the task is to maximize the number…

### Count of distinct integers in range [1, N] that do not have any subset sum as K

Count of distinct integers in range [1, N] that do not have any subset sum as KGiven two positive integers…