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 Apr 9, 2024
1 parent fee7295 commit ac7830b
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 ac7830b

Please sign in to comment.