top of page

PROGRAMMING CHALLENGES

Parentheses Balancer

Difficulty:

2 Medium

2.3 Stacks

Topic:

Write a program that checks if a string of parentheses is balanced using a stack. The program should return true if the parentheses are balanced and false otherwise. Implement this in pseudocode or Python.

Push opening parentheses onto the stack and pop for each closing parenthesis. If the stack is empty at the end, the string is balanced.

Need help with your programming skills?

If you need more help than just independent practise, then we're here for you. Book a 1:1 with us and we will be able to guide you to becoming a proficient programmer who can tackle any of the challenges an exam board can throw at you.

bottom of page