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

5 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.Max StackMedium
  4. 4.Valid ParenthesesMedium
  5. 5.Simplify PathMedium

Want to confidently pass your next coding interview?

Stack Bash helps new and veteran software engineers master data structures and algorithms for technical interviews.