Correct Parenthesis (Stack)
Problem If parentheses are entered, it outputs “YES” if it is a valid parenthesis, and “NO” if it is not correct. (())() This is the correct placement of the pair of parentheses, but (()())) is not the correct parentheses. input A string of parentheses is entered on the first line The maximum length…