Esempio n. 1
0
        private static IEnumerable <string> ProcessCases(IEnumerable <List <string> > cases)
        {
            var currentCaseNumber = 0;

            foreach (var caseLines in cases)
            {
                currentCaseNumber++; //1-indexed.
                var parsedCase = new CaseInput(caseLines);
                var solver     = new CaseSolver(parsedCase);
                var result     = solver.Solve();

                var resultText = result.ToString();

                yield return($"Case #{currentCaseNumber}: {resultText}");
            }
        }
Esempio n. 2
0
        public void Square()
        {
            var inputString = @"4
2
1 5
4
1 4 2 3
5
10 10 10 10 10
4
7 1 3 1000000";
            var io          = new TestIOStub(inputString);

            CaseSolver.Run(io);

            io.Output.Should().BeEquivalentTo(
                @"Case #1: 2",
                "Case #2: 3",
                "Case #3: 5",
                "Case #4: 2");
        }