Geek Culture
Published in

Geek Culture

Solve the Valid Parentheses Problem Using Stack

How to solve the valid parentheses (balanced brackets) problem using the stack data structure

code and coffee
Photo by Artem Sapegin on Unsplash

When writing an expression containing brackets, we make sure the ordering of the brackets is right, and an opening bracket always ends with the same type of closing bracket.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store