From a9342861e59c31a71cca6a9b31d214abb7ca77d5 Mon Sep 17 00:00:00 2001 From: Olivia Appleton Date: Sun, 15 Sep 2024 21:44:19 -0500 Subject: [PATCH] Attempt p7 in Java (9) --- java/src/main/java/euler/p0007.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/java/src/main/java/euler/p0007.java b/java/src/main/java/euler/p0007.java index 605480f3..cec11e84 100644 --- a/java/src/main/java/euler/p0007.java +++ b/java/src/main/java/euler/p0007.java @@ -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(); } } \ No newline at end of file