(This question is a variation of the LeetCode question 38. Count and Say. If you haven't completed that question yet, it is recommended to solve it first.)
The classic count-and-say sequence encode an input string of digits by reading consecutive identical digits and outputting the count (which may be one or two digits) followed by the digit itself. For example, the string "3322251" can be encoded to "23321511" by converting "33" to "23" (meaning two consecutive "3"), "222" to "32", "5" to "15", and "1" to "11".
Given a string encoded that was produced by exactly one count-and-say transformation, find all possible original digit strings that could result in such a given encoding. Note that each count in the given string is at most two digits long (i.e., between 1 and 99) and must not start with a zero. You may return the results in any order.
Constraints:
- 1 <=
encoded.length<= 20 encodedconsists only of digits '0'-'9'.- No count has a leading zero.
- Each count is between 1 and 99 (inclusive).
Example 1:
Input: encoded = "12114" Output: ["244444444444", "1111111111114"] Explanation: Parsing "12" as one occurrence of "2", and "114" as eleven occurrences of "4" produces "244444444444". Alternatively, parsing "121" as twelve occurrences of "1", and "14" as one occurrence of "4" produces "1111111111114". However, interpretations like parsing "12114" as 1,211 occurrences of "4" are invalid.
Example 2:
Input: encoded = "111213" Output: ["123", "11111111111333333333333333333333"]
Example 3:
Input: encoded = "1213" Output: ["23"]
