The Paired Doors
A easy Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- easy
- Seniority
- L3
Problem
A linter for our query templates rejects expressions whose grouping symbols don't line up. Given a string `s` drawn only from the characters '()[]{}', return `True` when each closing bracket matches the most recently opened bracket of the same kind and nothing is left open, and `False` otherwise. An empty string counts as balanced.
Summary
Every door you open is a promise to close it, in order.
Practice This Problem
Solve this Python problem with real code execution. DataDriven runs your Python code in a real environment and grades it automatically.