Skip to content

Commit

Permalink
Use Index()
Browse files Browse the repository at this point in the history
Use the new `Index()` method.
  • Loading branch information
martincostello committed Mar 12, 2024
1 parent 311eebd commit 4f6397d
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/ProjectEuler/Puzzles/Puzzle025.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,11 @@ internal static IEnumerable<BigInteger> Fibonacci()
/// <inheritdoc />
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;
}
}
Expand Down

0 comments on commit 4f6397d

Please sign in to comment.