about | help | code help+videos | done | prefs |
parensBalanced
Return true if parentheses in the string are balanced, and false if they are not. Every opening parenthesis '(' needs to correspond to a closing parenthesis ')' later in the string. For example, '()' is balanced, but '(()' is not. For the purposes of this challenge, you may assume there will not be more closing parentheses than opening ones, and the first parenthesis in the string will be an open parenthesis. parensBalanced("(())") → true parensBalanced("()()") → true parensBalanced("(()())") → true ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Copyright Nick Parlante 2017 - privacy