The following leetcode excercise will help you to practice using strings and stacks. https://leetcode.com/problems/valid-parentheses/ Problem #20. Valid Parentheses Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. An input string is valid if: Open brackets must be…