http://www.nxcoding.com/archives/leetcode-daily-2116-valid-parentheses-string-redundancy-method