3
vector<int> maxDepthAfterSplit(string seq) {4
// since we want the difference to be as low as possible so we will try to5
// balance both A and B by trying to maintain the number of paranthesis as6
// close as close as possible7
vector<int> indexA, indexB, res(seq.length(), 0);8
// initailly assuming all parenthesis belong to A so filling res with 010
int addToA = 0, addToB = 0;11
while (i < seq.length()) {13
if (addToA <= addToB) {14
// adding depth to A when it's depth is lesser or equal to b22
// removing depth from string whose depth is maximum as we have to keep23
// the difference minimum24
if (addToA >= addToB) {34
for (i = 0; i < indexB.size(); i++) {