Locked

Pass the Dictionary check first

Everything after it builds on dictionaries. Each rep in the check has to be passed without opening the solution. Hints and Basics are fine.

Still to clear · 8 of 8

Continue the check

Preview · where this ladder is heading

Valid Parentheses

s is a string made only of the six characters ( ) [ ] { }. Return True if s is well formed, otherwise False. It is well formed when all of these hold:

  • every opening bracket is closed by a bracket of the same kind
  • brackets close in the reverse order they opened (inner pairs close first)
  • no closing bracket appears without a matching opener

The empty string counts as well formed.

is_valid("([]{})") → True is_valid("([)]") → False (the ) closes before the inner [ does)

ins = "()[]{}"outTrue
ins = "([)]"outFalse
ins = "{[]}"outTrue

You can read it now. The editor opens when the check is cleared.