Deviopath › JavaScript

Balanced Parentheses

Medium · Strings

Write a function isBalanced that takes a string made only of ( and ) and returns true if the parentheses are balanced.

Balanced means every ( has a matching ) after it, and no ) appears before its (.

Next: Sum Nested Arrays