Skip to content

Commit

Permalink
Attempt p7 in Java (9)
Browse files Browse the repository at this point in the history
  • Loading branch information
LivInTheLookingGlass committed Sep 16, 2024
1 parent 983a371 commit a934286
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions java/src/main/java/euler/p0007.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@
public class p0007 implements IEuler {
@Override
public Object answer() {
return (int) Primes.primes()
.skip(10000)
.findFirst()
.orElseThrow(() -> new RuntimeException("Prime number not found"));
return Primes.primes()
.skip(10000)
.findFirst()
.get()
.intValue();
}
}

0 comments on commit a934286

Please sign in to comment.