DEV Community

Discussion on: Daily Challenge #51 - Valid Curly Braces

Collapse
 
alfredosalzillo profile image
Alfredo Salzillo

Write a function areCurlyBracesMatched that takes in a string s containing only { and/or } and returns true if s is properly matched, and false otherwise.

For this challenge the string can only contain '{' or '}', so your example is not a valid input.

It's obvious that it can't be resolved with a regexp for the general case.