diff --git a/java/src/main/java/euler/p0076.java b/java/src/main/java/euler/p0076.java index 516ed1c0..c4998472 100644 --- a/java/src/main/java/euler/p0076.java +++ b/java/src/main/java/euler/p0076.java @@ -23,12 +23,11 @@ public class p0076 implements IEuler { @Override public Object answer() { - byte idx, sum = 100; - int answer = 0; - byte[] counts = new byte[101]; + int idx, sum = 100, answer = 0; + int[] counts = new int[101]; counts[2] = 100; while (counts[100] == 0) { - counts[2] += (byte) 2; + counts[2] += 2; if (sum >= 100) { answer += (100 + counts[2] - sum) / 2; idx = 2; @@ -37,12 +36,12 @@ public Object answer() { idx++; counts[idx] += idx; sum = 0; - for (byte i = (byte) (idx - 1); i < 101; i++) + for (int i = idx - 1; i < 101; i++) sum += counts[i]; } while (sum > 100); } sum = 0; - for (byte i = 0; i < 101; i++) + for (int i = 0; i < 101; i++) sum += counts[i]; } return answer; diff --git a/java/src/test/java/EulerTest.java b/java/src/test/java/EulerTest.java index f2360138..4c235022 100644 --- a/java/src/test/java/EulerTest.java +++ b/java/src/test/java/EulerTest.java @@ -30,7 +30,7 @@ static Stream data() throws IOException { new Object[] { p0020.class, false, Utilities.getAnswer(20) }, new Object[] { p0022.class, false, Utilities.getAnswer(22) }, new Object[] { p0034.class, false, Utilities.getAnswer(34) }, - // new Object[] { p0076.class, true, Utilities.getAnswer(76) }, + new Object[] { p0076.class, true, Utilities.getAnswer(76) }, new Object[] { p0836.class, false, Utilities.getAnswer(836) }); }