1003. Check If Word Is Valid After Substitutions
https://leetcode.com/problems/check-if-word-is-valid-after-substitutions/ Given a string s , determine if it is valid . A string s is valid if, starting with an empty string t = "" , you can transform t into s after performing the following operation any number of times : Insert string "abc" into any position in t . More formally, t becomes t left + "abc" + t right , where t == t left + t right . Note that t left and t right may be empty . Return true if s is a valid string, otherwise, return false . Example 1: Input: s = "aabcbc" Output: true Explanation: "" -> " abc " -> "a abc bc" Thus, "aabcbc" is valid. Example 2: Input: s = "abcabcababcc" Output: true Explanation: "" -> " abc " -> "abc abc " -> "abcabc abc " -> "abcabcab abc c" Thus, "abcabcababcc"...