An original string containing only lowercase English letters can be encoded using the following process:
Partition the string into a sequence of non empty substrings.
Replace any arbitrary number of these substrings with their respective lengths.
Concatenate the remaining substrings and length values in their original order.
Given two encoded strings s1 and s2, return true if there exists an original string that can be encoded into both s1 and s2, or false otherwise.
Constraints:
s1.length, s2.length
s1 and s2 consist of digits
The number of consecutive digits in s1 and s2 does not exceed
An original string containing only lowercase English letters can be encoded using the following process:
Partition the string into a sequence of non empty substrings.
Replace any arbitrary number of these substrings with their respective lengths.
Concatenate the remaining substrings and length values in their original order.
Given two encoded strings s1 and s2, return true if there exists an original string that can be encoded into both s1 and s2, or false otherwise.
Constraints:
s1.length, s2.length
s1 and s2 consist of digits
The number of consecutive digits in s1 and s2 does not exceed