Are they properly closed?

A code exercise of about 15 minutes: read the statement, solve «Are they properly closed?» in the browser and get a review like in a real interview.

Code · 15 min
Loading…

Statement

Write validBrackets(s): return true if the parentheses (), square brackets [] and braces {} of s are properly matched: each closes with its own kind and in the right order ("([])" yes, "([)]" no). Any other character is ignored.