Skip to content

Latest commit

 

History

History
19 lines (12 loc) · 572 Bytes

Valid Parentheses.md

File metadata and controls

19 lines (12 loc) · 572 Bytes

Write a function called that takes a string of parentheses, and determines if the order of the parentheses is valid. The function should return true if the string is valid, and false if it's invalid.

Examples

"()"              =>  true
")(()))"          =>  false
"("               =>  false
"(())((()())())"  =>  true

Constraints

0 <= input.length <= 100

You may assume that the input string will only contain opening and closing parenthesis and will not be an empty string.

solution