Fidessa Interview Question

Matching pairs in string