Amazon Interview Question

Question was to validate brackets in string, with 3 types of brackets.

Interview Answer

Anonymous

Apr 13, 2017

Answered wrong by counting opened, and closed once. Then adjusted code to push and pull last element to array(stack) linear algorithm complexity.