DXC Technology Interview Question

balanced parenthesis & basis array question.