bool isCryptSolution(string[] crypt, char[][] solution) { var words = new List<decimal>(); foreach (var word in crypt) { decimal wordsum = 0; for (var ci = 0; ci < word.Length; ci++) foreach (char[] t in solution) { if (word[ci] != t[0]) continue; if (word[0] == t[0] && t[1] == '0' && word.Length != 1) return false; wordsum += Convert.ToInt32(t[1].ToString()) * Convert.ToDecimal(Math.Pow(10, word.Length - 1 - ci)); break; } words.Add(wordsum); } return words[2] == words[0] + words[1]; }
Previous