Amazon Interview Question

Write an algorithm to check if a string has balanced parentheses. What about if brackets [] or braces {} could be used as well and those also had to be balanced?