DXC Technology interview question

balanced parenthesis & basis array question.