BackmediumStacks and Queues stacks-and-queues medium

Validate Balanced Brackets Solution

Problem Statement

Given a string of parentheses, brackets, and curly brackets, determine if the string is balanced.

Example 1
Input
({[]})
Output
true

Explanation: The string has balanced pairs of brackets.

Constraints

  • Input string only contains parentheses, brackets, and curly brackets.
  • Input string can be empty or contain multiple opening/closing bracket pairs.
  • Input string does not contain any invalid bracket pairs.
Live Compiler
Loading...
Test Cases & Output
🔒 Sign up to run your code

🚀 Practice this problem

Run code, get AI hints & track streak

Sign Up Free