Practice Real Company Assessment Patterns • Latest 2025–2026 Mock Tests

Programming Exercises

Write a function that checks if a given string of parentheses ((), {}, []) is balanced using a stack-based approach.

Hard

Problem Statement

Write a function that checks if a given string of parentheses ((), {}, []) is balanced using a stack-based approach.

Sample Input

"({[]})"

Sample Output

true

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
package main import "fmt" func isBalanced(s string) bool { // Your code here } func main() { fmt.Println(isBalanced("({[]})")) // Expected Output: true fmt.Println(isBalanced("({[})")) // Expected Output: false }
Log in or sign up to run or submit your code.Log inSign up
Input
"({[]})"
Expected Output
true