This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Day17 { | |
private static final int TARGET = 150; | |
private int[] buckets = { 11, 30, 47, 31, 32, 36, 3, 1, 5, 3, 32, 36, 15, | |
11, 46, 26, 28, 1, 19, 3 }; | |
private int minBuckets; | |
public static void main(String[] args) { | |
Day17 day17 = new Day17(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.ArrayList; | |
import java.util.HashMap; | |
import java.util.List; | |
import java.util.Map; | |
import java.util.regex.Matcher; | |
import java.util.regex.Pattern; | |
public class Day16 { | |
private final static String FILENAME = ".\\InputDay16.txt"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.regex.Matcher; | |
import java.util.regex.Pattern; | |
public class Day15 { | |
private final static String FILENAME = ".\\InputDay15.txt"; | |
private final static Pattern PATTERN = Pattern.compile("(?<name>.+): capacity (?<cap>-??\\d+), durability (?<dur>-??\\d+), flavor (?<flav>-??\\d+), texture (?<tex>-??\\d+), calories (?<cal>-??\\d+)"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.regex.Matcher; | |
import java.util.regex.Pattern; | |
public class Day14v2 { | |
private static final String FILENAME = "D:\\Dokumente\\Java Workspace\\AdventOfCodeDay14\\InputDay14.txt"; | |
private static final Pattern PATTERN = Pattern |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.regex.Matcher; | |
import java.util.regex.Pattern; | |
public class Day14 { | |
private static final String FILENAME = "D:\\Dokumente\\Java Workspace\\AdventOfCodeDay14\\InputDay14.txt"; | |
private static final Pattern PATTERN = Pattern |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.ArrayList; | |
import java.util.Collection; | |
import java.util.List; | |
import java.util.Map; | |
import java.util.regex.Matcher; | |
import java.util.regex.Pattern; | |
import java.util.stream.Stream; | |
import com.google.gson.Gson; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.HashSet; | |
import java.util.Set; | |
public class Day11 { | |
public static void main(String[] args) { | |
String test1 = "abcdefgh"; | |
String expected1 = "abcdffaa"; | |
String test2 = "ghijklmn"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Day10 { | |
public final static int ITERATIONS_PART_1 = 40; | |
public final static int ITERATIONS_PART_2 = 50; | |
public static void main(String[] args) { | |
String input = "1321131112"; | |
System.out.println("Part 1: " + runSequence(input, ITERATIONS_PART_1)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.awt.Point; | |
import java.io.BufferedReader; | |
import java.io.FileReader; | |
import java.io.IOException; | |
import java.util.HashSet; | |
import java.util.Set; | |
public class Day3 { | |
public static void main(String[] args) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.awt.Point; | |
import java.io.BufferedReader; | |
import java.io.FileReader; | |
import java.io.IOException; | |
import java.util.ArrayList; | |
import java.util.List; | |
public class Day3 { | |
public static void main(String[] args) { |