Topic: Stack Problem / Level: intermediate

Problem: Create a function to simulate a stack-based solution for solving the longest valid parentheses substring problem.

Run the code to see the output here...