public static void Run(IGoogleCodeJamCommunicator io = null) { InOut = io ?? new GoogleCodeJam2018Communicator(); var lines = InOut.ReadStringInput(out numberOfCases); var cases = new CaseSplitter().Configure_TakingNFromFirstValPlusOne().GetCaseLines(lines); var results = new List <string>(); var caseNumber = 0; foreach (var caseLines in cases) { caseNumber++; //1-indexed. var parsedCase = new CaseInput(caseLines); var solver = new CaseSolver(parsedCase); var result = solver.Solve(); var resultText = result.ToString(); results.Add($"Case #{caseNumber}: {resultText}"); } InOut.WriteOutput(results); }
internal CaseSolver(CaseInput inputCase) { input = inputCase; }