StoreHub Interview Question

Solve valid parenthesis leetcode question