Booking.com Interview Question

Check the string for the correct using of parenthesis. They can be (), [], {}.

Interview Answer

Anonymous

Apr 6, 2016

Use stack to collect opening parenthesis and check correctness when find closing one. At last stack must be empty to mark sring as correct.

5