Exemplo n.º 1
0
        public override string GetSolution()
        {
            for (int i = 0; i < 6; i++)
            {
                code.SetValue(i, int.Parse(inputCodes[0].Substring(i, 1)));
            }

            int validCodes = 0;

            Console.WriteLine(code.GetFullNumber());
            while (code.GetFullNumber() < codeTo)
            {
                if (IsNumberValid(code.GetSequence()))
                {
                    validCodes++;
                    Console.WriteLine(code.GetFullNumber());
                }

                code.Increase();
            }

            return(validCodes.ToString());
        }