Stack Bash - Master data structures and algorithms

Valid Parentheses

Medium
Given a single string of opening and closing brackets: (), [], {}, write a function that returns True if the open brackets are closed properly, and False if it is not.
For example, given the following string:
[{()}]
Your function should return True since all brackets are closed properly.
However, the input string:
({()}]
is invalid since the last character doesn't close its respective bracket.

Try it first

Solution

6 Essential Stacks & Queues Coding Interview Problems

Master Stacks & Queues by trying the coding challenges below.
  1. 1.Implement StackEasy
  2. 2.Implement QueueEasy
  3. 3.Valid stack sequenceMedium
  4. 4.Max StackMedium
  5. 5.Valid ParenthesesMedium
  6. 6.Simplify PathMedium