Problem Submissions Solution

Check for balanced Paranthesis

Difficulty: Easy

Acceptance: %

Points: 20.00

You are given a string s that contains a mix of brackets: {}, (), and []. Your goal is to determine if the brackets in the string are balanced. A string is considered balanced if every opening bracket has a corresponding closing bracket, and the brackets are properly nested in the correct order.

Topics

Companies

Articles

Examples:

Expected Time Complexity: O(n)

Expected Auxiliary Space: O(n)

Constraints:
  • 1 <= s.size() <= 10^6
  • s[i] ? {'{', '}', '(', ')', '[', ']'}
Companies:
Amazon Microsoft Walmart Adobe Google + 2 more
Topics:
Stack
Locked Content
Access Restricted: Please Login to access the code editor and test cases.