Impetus Technologies interview question

Leetcode easy Valid parenthesis with some modifications and implementation of stack.