Skip to content

Instantly share code, notes, and snippets.

💭
Busy being amazing

Chris Neve ChrisLeNeve

💭
Busy being amazing
Block or report user

Report or block ChrisLeNeve

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ChrisLeNeve
ChrisLeNeve / scratch_13.java
Created Nov 13, 2019
Project Euler, problem 11 finalised
View scratch_13.java
class Scratch {
static long CURRENT_MAX = Long.MIN_VALUE;
public static void main(String[] args) {
int[][] grid = setupGrid();
computeMaxProduct(grid);
System.out.println(CURRENT_MAX);
}
private static void computeMaxProduct(int[][] grid) {
@ChrisLeNeve
ChrisLeNeve / scratch_9.java
Created Oct 25, 2019
Project Euler problem 10
View scratch_9.java
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
class Scratch {
static final boolean COMPOSITE = false;
static final boolean PRIME = true;
public static void main(String[] args) {
@ChrisLeNeve
ChrisLeNeve / scratch_8.java
Created Oct 23, 2019
Project Euler - problem 9
View scratch_8.java
class Scratch {
public static void main(String[] args) {
Scratch s = new Scratch();
Triplet t = s.solution();
System.out.println("The triplet is: " + t.a + "," + t.b + "," + t.c);
int product = t.a * t.b * t.c;
}
private Triplet solution() {
@ChrisLeNeve
ChrisLeNeve / scratch_7.java
Created Oct 22, 2019
Project Euler, problem 8
View scratch_7.java
import java.math.BigInteger;
class Scratch {
private static String NUMBER = "73167176531330624919225119674426574742355349194934" +
"96983520312774506326239578318016984801869478851843" +
"85861560789112949495459501737958331952853208805511" +
"12540698747158523863050715693290963295227443043557" +
"66896648950445244523161731856403098711121722383113" +
"62229893423380308135336276614282806444486645238749" +
"30358907296290491560440772390713810515859307960866" +
@ChrisLeNeve
ChrisLeNeve / scratch_7.java
Created Oct 14, 2019
Project euler problem 7 - take 1
View scratch_7.java
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.List;
class Scratch {
public static void main(String[] args) {
System.out.println(solution());
}
private static int solution() {
@ChrisLeNeve
ChrisLeNeve / scratch_6.java
Created Oct 14, 2019
Project Euler: problem 6
View scratch_6.java
class Scratch {
public static void main(String[] args) {
System.out.println(solution(10));
}
private static int solution(int max) {
int sumOfSquares = 0, sum = 0;
for (int i = 1; i <= max; i++) {
sumOfSquares += (i * i);
sum += i;
@ChrisLeNeve
ChrisLeNeve / largest_palindrome.java
Last active Oct 2, 2019
Project Euler 4: largest palindrome
View largest_palindrome.java
import java.util.TreeSet;
class Scratch {
static StringBuilder sb = new StringBuilder();
public static void main(String[] args) {
int solution = findLargestPalindrome();
System.out.println(solution);
}
@ChrisLeNeve
ChrisLeNeve / scratch_3.java
Created Oct 1, 2019
Find largest prime factor
View scratch_3.java
import java.util.HashMap;
import java.util.Map;
class Scratch {
public static void main(String[] args) {
long number = 600851475143L;
// long number = 13195;
long result = findLargestPrimeFactor(number);
System.out.println(result);
}
@ChrisLeNeve
ChrisLeNeve / even-fib
Created Sep 30, 2019
projecteuler problem 2
View even-fib
import java.util.Set;
import java.util.TreeSet;
class Scratch {
public static void main(String[] args) {
long sum = findSolution();
System.out.println(sum);
}
private static long findSolution() {
@ChrisLeNeve
ChrisLeNeve / multiples-3-5.java
Created Sep 30, 2019
projecteuler.net: problem 1
View multiples-3-5.java
import java.util.List;
import java.util.Set;
import java.util.TreeSet;
class Scratch {
public static void main(String[] args) {
// int max = 10; // 23
int max = 1000; // 233168
int sum = findMultiplesV2(max);
System.out.println("Sum is: " + sum);
You can’t perform that action at this time.