Bloomberg 店面

Question: https://leetcode.com/problems/valid-parentheses/

Follow-up:
What if we add single quotations marks?

Example 1:

Input: {’}’
Output: false
Explanation: Because we only have 1 quotation after bracket.

Example 2:

Input: {’’}
Output: true
Explanation: Dont have any quotation after bracket.

Example 3:

Input: {’’}’’
Output: true
Explanation: number of quotation % 2 == 0

My solution: Make a counter after the closed bracket and count it