public Output FindSum(Input input) { var sum = 0; //Edit & Continue :) //for (var i = input.Start; i < input.End; i++) //{ // if (i%3 == 0 || i%5 == 0) // { // sum += i; // } //} return new Output {Input = input,Value = sum}; }
public Output CalculateMaxCycles(Input input) { var maxCycleLength = 0; for (var i = input.Start; i < input.End; i++) { var cycleLength = ComputeCycleLength(i); if (cycleLength > maxCycleLength) { maxCycleLength = cycleLength; } } return new Output { Input = input, Value = maxCycleLength }; }