python
beginner
हल किया
2026-11-17 को समाप्त
Balanced brackets
Write is_balanced(text) that returns True when every (, [ and { in the text is closed by the matching bracket in the right order.
- Other characters are ignored, so
"print(items[0])"is balanced. "(]"and"(()"are not.
Acceptance criteria
- An empty string is balanced.
- The tests at the bottom print
All tests passed.
Hint: a stack (a Python list) is all you need.
अब तक 0 लोगों ने हल किया।
एडिटरCtrl + Enter
जब टेस्ट "All tests passed" दिखाते हैं, तो चैलेंज इस ब्राउज़र में हल के रूप में चिह्नित हो जाता है।
अपना समाधान समीक्षा के लिए भेजें