Wayfair Interview Question

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