# partition

### 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…

### Partition a Linked List into 3 parts such that the maximum difference between their sizes is minimum

#include using namespace std;  class Node {public:    int data;    Node* next;};  int sizeOfLL(Node* head){    int size = 0;          while (head != NULL) {        ++size;        head = head->next;    }    return size;}  vector…

### Split an array into subarrays with maximum Bitwise XOR of their respective Bitwise OR values

Split an array into subarrays with maximum Bitwise XOR of their respective Bitwise OR valuesGiven an array arr[] consisting of…

### Check if a Binary String can be split into disjoint subsequences which are equal to “010”

Check if a Binary String can be split into disjoint subsequences which are equal to “010”Given a binary string, S…

### Split array into K subarrays such that sum of maximum of all subarrays is maximized

#include using namespace std;  void partitionIntoKSegments(int arr[],                            int N, int K){        if (N < K) {        cout

### Count ways to split array into two subsets having difference between their sum equal to K

Count ways to split array into two subsets having difference between their sum equal to KGiven an array A[] of…

### Count ways to split array into three non-empty subarrays having equal Bitwise XOR values

Count ways to split array into three non-empty subarrays having equal Bitwise XOR valuesGiven an array arr[] consisting of N…