Skip to content

Latest commit

 

History

History
27 lines (18 loc) · 730 Bytes

ValidParentheses.md

File metadata and controls

27 lines (18 loc) · 730 Bytes

ValidParentheses

Difficulty Tags Solution Link
Medium
RevealStacks
To Do

Problem Description

You're working with an intern that keeps coming to you with code that won't run because the braces, brackets, and parentheses are off. To save you both some time, you decide to write a braces/brackets/parentheses validator. Let's say:

'(', '{', '[' are called "openers."
')', '}', ']' are called "closers."

Write an efficient function that tells us whether or not an input string's openers and closers are properly nested.

Samples

Input Output
"{ [ ] ( ) }" true
"{ [ ( ] ) }" false
"{ [ }" false