public static void Main()
string S = "3x2x", T = "8";
string decodedS = decode(S);
string decodedT = decode(T);
Console.WriteLine(decodedS);
Console.WriteLine(decodedT);
if(decodedS.Length != decodedT.Length) {
for(int i =0; i < decodedS.Length; i++){
if(decodedS[i] == '?' || decodedT[i] == '?')
result = decodedS[i] == decodedT[i];
Console.WriteLine(result);
public static string decode(string str){
string finalStr = string.Empty;
string len = string.Empty;
for(int i = 0; i < str.Length; i++){
if(!string.IsNullOrEmpty(len))
finalStr+=new String('?', Convert.ToInt32(len));
if(!string.IsNullOrEmpty(len))
finalStr+=new String('?', Convert.ToInt32(len));