This is an exercise from site Codewars, developed on JavaScript!
Write a function 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
To install Jest to run the tests:
npm install --save-dev jest
To run the test:
npm test