MicroStrategy interview question

Valid Parenthesis grouping, binary search (hacker-rank)