Wayfair interview question

Balanced brackets problem, debug a php code and each possible combination of elements in vector of vectors.