diff --git a/src/ProjectEuler/Puzzles/Puzzle025.cs b/src/ProjectEuler/Puzzles/Puzzle025.cs index 02a0bd16..052bc57d 100644 --- a/src/ProjectEuler/Puzzles/Puzzle025.cs +++ b/src/ProjectEuler/Puzzles/Puzzle025.cs @@ -45,15 +45,11 @@ internal static IEnumerable Fibonacci() /// protected override int SolveCore(string[] args) { - int index = 0; - - foreach (BigInteger value in Fibonacci()) + foreach ((int index, BigInteger value) in Fibonacci().Index()) { - index++; - if (value >= Limit) { - Answer = index; + Answer = index + 1; break; } }