Compare commits
14
Commits
65d86e9f9f
..
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fab6be8091 | ||
|
|
5a814d807f | ||
|
|
71f8edaa7a | ||
|
|
dbcdfb83fc | ||
|
|
973b2febb0 | ||
|
|
11d0318153 | ||
|
|
b5d98ad935 | ||
|
|
a70d9fafee | ||
|
|
64b020ff65 | ||
|
|
a975d18556 | ||
|
|
49f975fd20 | ||
|
|
44f61ea190 | ||
|
|
ca34aef653 | ||
|
|
3230e1decc |
No files matched your search
+42
-13
@@ -1,25 +1,54 @@
|
||||
# ---> Kotlin
|
||||
# Compiled class file
|
||||
# IntelliJ IDEA
|
||||
.idea/
|
||||
*.iml
|
||||
*.iws
|
||||
*.iws.original
|
||||
*.ipr
|
||||
*.class
|
||||
|
||||
# Log file
|
||||
# Gradle
|
||||
.gradle/
|
||||
build/
|
||||
!gradle-wrapper.jar
|
||||
|
||||
# Kotlin
|
||||
*.kotlin_module
|
||||
|
||||
# OS-specific files
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
|
||||
# Logs and databases
|
||||
*.log
|
||||
*.log.*
|
||||
*.json
|
||||
*.sqlite
|
||||
*.db
|
||||
*.hprof
|
||||
|
||||
# BlueJ files
|
||||
*.ctxt
|
||||
|
||||
# Mobile Tools for Java (J2ME)
|
||||
.mtj.tmp/
|
||||
|
||||
# Package Files #
|
||||
# Compiled files
|
||||
*.jar
|
||||
*.war
|
||||
*.nar
|
||||
*.ear
|
||||
*.zip
|
||||
*.tar.gz
|
||||
*.rar
|
||||
|
||||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||
hs_err_pid*
|
||||
# Dependency directories
|
||||
/bin/
|
||||
/build/
|
||||
/lib/
|
||||
/out/
|
||||
/target/
|
||||
|
||||
# Eclipse
|
||||
.settings/
|
||||
|
||||
# User-specific files
|
||||
*.suo
|
||||
*.user
|
||||
*.swp
|
||||
*.DS_Store
|
||||
|
||||
# Visual Studio Code
|
||||
.vscode/
|
||||
Generated
+54
@@ -0,0 +1,54 @@
|
||||
# IntelliJ IDEA
|
||||
.idea/
|
||||
*.iml
|
||||
*.iws
|
||||
*.iws.original
|
||||
*.ipr
|
||||
*.class
|
||||
|
||||
# Gradle
|
||||
.gradle/
|
||||
build/
|
||||
!gradle-wrapper.jar
|
||||
|
||||
# Kotlin
|
||||
*.kotlin_module
|
||||
|
||||
# OS-specific files
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
|
||||
# Logs and databases
|
||||
*.log
|
||||
*.log.*
|
||||
*.json
|
||||
*.sqlite
|
||||
*.db
|
||||
*.hprof
|
||||
|
||||
# Compiled files
|
||||
*.jar
|
||||
*.war
|
||||
*.ear
|
||||
*.zip
|
||||
*.tar.gz
|
||||
*.rar
|
||||
|
||||
# Dependency directories
|
||||
/bin/
|
||||
/build/
|
||||
/lib/
|
||||
/out/
|
||||
/target/
|
||||
|
||||
# Eclipse
|
||||
.settings/
|
||||
|
||||
# User-specific files
|
||||
*.suo
|
||||
*.user
|
||||
*.swp
|
||||
*.DS_Store
|
||||
|
||||
# Visual Studio Code
|
||||
.vscode/
|
||||
@@ -0,0 +1,27 @@
|
||||
plugins {
|
||||
kotlin("jvm") version "1.9.21"
|
||||
application
|
||||
}
|
||||
|
||||
group = "nl.apirapi.adventofcode"
|
||||
version = "1.0-SNAPSHOT"
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
testImplementation(kotlin("test"))
|
||||
}
|
||||
|
||||
tasks.test {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
|
||||
kotlin {
|
||||
jvmToolchain(21)
|
||||
}
|
||||
|
||||
application {
|
||||
mainClass.set("MainKt")
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
|
||||
networkTimeout=10000
|
||||
validateDistributionUrl=true
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
@@ -0,0 +1,248 @@
|
||||
#!/bin/sh
|
||||
|
||||
#
|
||||
# Copyright © 2015-2021 the original authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
# Gradle start up script for POSIX generated by Gradle.
|
||||
#
|
||||
# Important for running:
|
||||
#
|
||||
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
|
||||
# noncompliant, but you have some other compliant shell such as ksh or
|
||||
# bash, then to run this script, type that shell name before the whole
|
||||
# command line, like:
|
||||
#
|
||||
# ksh Gradle
|
||||
#
|
||||
# Busybox and similar reduced shells will NOT work, because this script
|
||||
# requires all of these POSIX shell features:
|
||||
# * functions;
|
||||
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
|
||||
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
|
||||
# * compound commands having a testable exit status, especially «case»;
|
||||
# * various built-in commands including «command», «set», and «ulimit».
|
||||
#
|
||||
# Important for patching:
|
||||
#
|
||||
# (2) This script targets any POSIX shell, so it avoids extensions provided
|
||||
# by Bash, Ksh, etc; in particular arrays are avoided.
|
||||
#
|
||||
# The "traditional" practice of packing multiple parameters into a
|
||||
# space-separated string is a well documented source of bugs and security
|
||||
# problems, so this is (mostly) avoided, by progressively accumulating
|
||||
# options in "$@", and eventually passing that to Java.
|
||||
#
|
||||
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
|
||||
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
|
||||
# see the in-line comments for details.
|
||||
#
|
||||
# There are tweaks for specific operating systems such as AIX, CygWin,
|
||||
# Darwin, MinGW, and NonStop.
|
||||
#
|
||||
# (3) This script is generated from the Groovy template
|
||||
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||
# within the Gradle project.
|
||||
#
|
||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
|
||||
# Resolve links: $0 may be a link
|
||||
app_path=$0
|
||||
|
||||
# Need this for daisy-chained symlinks.
|
||||
while
|
||||
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
|
||||
[ -h "$app_path" ]
|
||||
do
|
||||
ls=$( ls -ld "$app_path" )
|
||||
link=${ls#*' -> '}
|
||||
case $link in #(
|
||||
/*) app_path=$link ;; #(
|
||||
*) app_path=$APP_HOME$link ;;
|
||||
esac
|
||||
done
|
||||
|
||||
# This is normally unused
|
||||
# shellcheck disable=SC2034
|
||||
APP_BASE_NAME=${0##*/}
|
||||
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD=maximum
|
||||
|
||||
warn () {
|
||||
echo "$*"
|
||||
} >&2
|
||||
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
} >&2
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
nonstop=false
|
||||
case "$( uname )" in #(
|
||||
CYGWIN* ) cygwin=true ;; #(
|
||||
Darwin* ) darwin=true ;; #(
|
||||
MSYS* | MINGW* ) msys=true ;; #(
|
||||
NONSTOP* ) nonstop=true ;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD=$JAVA_HOME/jre/sh/java
|
||||
else
|
||||
JAVACMD=$JAVA_HOME/bin/java
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD=java
|
||||
if ! command -v java >/dev/null 2>&1
|
||||
then
|
||||
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||
case $MAX_FD in #(
|
||||
max*)
|
||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC3045
|
||||
MAX_FD=$( ulimit -H -n ) ||
|
||||
warn "Could not query maximum file descriptor limit"
|
||||
esac
|
||||
case $MAX_FD in #(
|
||||
'' | soft) :;; #(
|
||||
*)
|
||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||
# shellcheck disable=SC3045
|
||||
ulimit -n "$MAX_FD" ||
|
||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||
esac
|
||||
fi
|
||||
|
||||
# Collect all arguments for the java command, stacking in reverse order:
|
||||
# * args from the command line
|
||||
# * the main class name
|
||||
# * -classpath
|
||||
# * -D...appname settings
|
||||
# * --module-path (only if needed)
|
||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
|
||||
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if "$cygwin" || "$msys" ; then
|
||||
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
||||
|
||||
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
for arg do
|
||||
if
|
||||
case $arg in #(
|
||||
-*) false ;; # don't mess with options #(
|
||||
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
|
||||
[ -e "$t" ] ;; #(
|
||||
*) false ;;
|
||||
esac
|
||||
then
|
||||
arg=$( cygpath --path --ignore --mixed "$arg" )
|
||||
fi
|
||||
# Roll the args list around exactly as many times as the number of
|
||||
# args, so each arg winds up back in the position where it started, but
|
||||
# possibly modified.
|
||||
#
|
||||
# NB: a `for` loop captures its iteration list before it begins, so
|
||||
# changing the positional parameters here affects neither the number of
|
||||
# iterations, nor the values presented in `arg`.
|
||||
shift # remove old arg
|
||||
set -- "$@" "$arg" # push replacement arg
|
||||
done
|
||||
fi
|
||||
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Collect all arguments for the java command;
|
||||
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
||||
# shell script including quotes and variable substitutions, so put them in
|
||||
# double quotes to make sure that they get re-expanded; and
|
||||
# * put everything else in single quotes, so that it's not re-expanded.
|
||||
|
||||
set -- \
|
||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||
-classpath "$CLASSPATH" \
|
||||
org.gradle.wrapper.GradleWrapperMain \
|
||||
"$@"
|
||||
|
||||
# Stop when "xargs" is not available.
|
||||
if ! command -v xargs >/dev/null 2>&1
|
||||
then
|
||||
die "xargs is not available"
|
||||
fi
|
||||
|
||||
# Use "xargs" to parse quoted args.
|
||||
#
|
||||
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
||||
#
|
||||
# In Bash we could simply go:
|
||||
#
|
||||
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
|
||||
# set -- "${ARGS[@]}" "$@"
|
||||
#
|
||||
# but POSIX shell has neither arrays nor command substitution, so instead we
|
||||
# post-process each arg (as a line of input to sed) to backslash-escape any
|
||||
# character that might be a shell metacharacter, then use eval to reverse
|
||||
# that process (while maintaining the separation between arguments), and wrap
|
||||
# the whole thing up as a single "set" statement.
|
||||
#
|
||||
# This will of course break if any of these variables contains a newline or
|
||||
# an unmatched quote.
|
||||
#
|
||||
|
||||
eval "set -- $(
|
||||
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
|
||||
xargs -n1 |
|
||||
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
|
||||
tr '\n' ' '
|
||||
)" '"$@"'
|
||||
|
||||
exec "$JAVACMD" "$@"
|
||||
Vendored
+92
@@ -0,0 +1,92 @@
|
||||
@rem
|
||||
@rem Copyright 2015 the original author or authors.
|
||||
@rem
|
||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@rem you may not use this file except in compliance with the License.
|
||||
@rem You may obtain a copy of the License at
|
||||
@rem
|
||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||
@rem
|
||||
@rem Unless required by applicable law or agreed to in writing, software
|
||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%"=="" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%"=="" set DIRNAME=.
|
||||
@rem This is normally unused
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if %ERRORLEVEL% equ 0 goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto execute
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if %ERRORLEVEL% equ 0 goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
set EXIT_CODE=%ERRORLEVEL%
|
||||
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||
exit /b %EXIT_CODE%
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
@@ -0,0 +1,14 @@
|
||||
import day1.Day1
|
||||
import day2.Day2
|
||||
import day2.Hand
|
||||
import day3.Day3
|
||||
|
||||
fun main() {
|
||||
println("Day 1-1: ${Day1.answerOne()}")
|
||||
println("Day 1-2: ${Day1.answerTwo()}")
|
||||
println("Day 2-1: ${Day2.sumOfCompatibleGames("src/main/resources/day2/input.txt", Hand(12,13,14))}")
|
||||
println("Day 2-2: ${Day2.powerOfMinimumSetOfCubes("src/main/resources/day2/input.txt")}")
|
||||
println("Day 3-1: ${Day3.sumOfSelectedParts("src/main/resources/day3/input.txt")}")
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package day1
|
||||
|
||||
import java.io.File
|
||||
|
||||
object Day1 {
|
||||
|
||||
fun calculateOne(input : List<String>) = input
|
||||
.filter(String::isNotBlank)
|
||||
.fold(0, addMagicNumber())
|
||||
|
||||
fun calculateTwo(input : List<String>) = input
|
||||
.filter(String::isNotBlank)
|
||||
.map(::replaceElvenNumbers)
|
||||
.fold(0, addMagicNumber())
|
||||
|
||||
private fun addMagicNumber() = { accumulator: Int, line: String ->
|
||||
val firstDigit = NUMBER_REGEX.findAll(line).first().value
|
||||
val secondDigit = NUMBER_REGEX.findAll(line).last().value
|
||||
val total = (firstDigit + secondDigit).toInt() + accumulator
|
||||
total
|
||||
}
|
||||
|
||||
private fun replaceElvenNumbers(string: String): String =
|
||||
string.mapIndexed { index, _ ->
|
||||
readElvenNumberAtStart(string.substring(index))
|
||||
}.joinToString(separator = "")
|
||||
|
||||
private fun readElvenNumberAtStart(string: String) = when {
|
||||
string.isBlank() -> ""
|
||||
string[0].isDigit() -> string[0].toString()
|
||||
string.startsWith("one") -> "1"
|
||||
string.startsWith("two") -> "2"
|
||||
string.startsWith("three") -> "3"
|
||||
string.startsWith("four") -> "4"
|
||||
string.startsWith("five") -> "5"
|
||||
string.startsWith("six") -> "6"
|
||||
string.startsWith("seven") -> "7"
|
||||
string.startsWith("eight") -> "8"
|
||||
string.startsWith("nine") -> "9"
|
||||
else -> ""
|
||||
}
|
||||
|
||||
fun answerOne() =
|
||||
File("src/main/resources/day1/input.txt")
|
||||
.readLines()
|
||||
.let(::calculateOne)
|
||||
|
||||
fun answerTwo() =
|
||||
File("src/main/resources/day1/input.txt")
|
||||
.readLines()
|
||||
.let(::calculateTwo)
|
||||
|
||||
private val NUMBER_REGEX = Regex("\\d")
|
||||
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
package day2
|
||||
|
||||
import java.io.File
|
||||
|
||||
object Day2 {
|
||||
|
||||
fun sumOfCompatibleGames(file: String, hand: Hand) = readGames(file)
|
||||
.filter { it.isCompatibleWith(hand) }
|
||||
.map(Game::id)
|
||||
.sum()
|
||||
|
||||
fun powerOfMinimumSetOfCubes(file: String) = readGames(file)
|
||||
.map(Game::powerOfHands)
|
||||
.sum()
|
||||
|
||||
private fun readGames(file: String): List<Game> =
|
||||
File(file)
|
||||
.readLines()
|
||||
.map(Game.Companion::parse)
|
||||
|
||||
}
|
||||
|
||||
data class Game(val id: Int, val hands: List<Hand>) {
|
||||
|
||||
fun isCompatibleWith(hand: Hand) =
|
||||
hand.fitsIn(maxOfHands())
|
||||
|
||||
fun powerOfHands() = maxOfHands().let { it.red * it.green * it.blue }
|
||||
|
||||
private fun maxOfHands() = hands.fold(Hand(0, 0, 0)) { currentMax: Hand, next: Hand ->
|
||||
Hand(
|
||||
maxOf(currentMax.red, next.red),
|
||||
maxOf(currentMax.green, next.green),
|
||||
maxOf(currentMax.blue, next.blue)
|
||||
)
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
||||
/**
|
||||
* Example string: "Game 1: 3 blue, 4 red; 1 red, 2 green, 6 blue; 2 green"
|
||||
*/
|
||||
fun parse(string: String) = string
|
||||
.split(':')
|
||||
.let {
|
||||
Game(
|
||||
id = NUMBER_REGEX.find(it[0])!!.value.toInt(),
|
||||
hands = it[1].split(';').map { Hand.parse(it) })
|
||||
}
|
||||
|
||||
|
||||
private val NUMBER_REGEX = Regex("\\d+")
|
||||
}
|
||||
}
|
||||
|
||||
data class Hand(val red: Int, val green: Int, val blue: Int) {
|
||||
fun fitsIn(other: Hand) = red >= other.red && green >= other.green && blue >= other.blue
|
||||
|
||||
companion object {
|
||||
|
||||
/**
|
||||
* Example string: "3 blue, 4 red"
|
||||
*/
|
||||
fun parse(string: String): Hand =
|
||||
Hand(
|
||||
RED_REGEX.find(string)?.groupValues?.get(1)?.toInt() ?: 0,
|
||||
GREEN_REGEX.find(string)?.groupValues?.get(1)?.toInt() ?: 0,
|
||||
BLUE_REGEX.find(string)?.groupValues?.get(1)?.toInt() ?: 0
|
||||
)
|
||||
|
||||
private val RED_REGEX = Regex("""(\d+)\s+red""")
|
||||
private val GREEN_REGEX = Regex("""(\d+)\s+green""")
|
||||
private val BLUE_REGEX = Regex("""(\d+)\s+blue""")
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package day3
|
||||
|
||||
import java.io.File
|
||||
|
||||
object Day3 {
|
||||
|
||||
fun sumOfSelectedParts(file: String): Int =
|
||||
readLines(file)
|
||||
.let { lines ->
|
||||
readParts(lines)
|
||||
.filter { parts -> parts.isSelected(lines) }
|
||||
}
|
||||
.sumOf { it.number }
|
||||
|
||||
fun readLines(file: String): List<String> =
|
||||
File(file)
|
||||
.readLines()
|
||||
|
||||
fun readParts(lines: List<String>): List<Part> =
|
||||
lines
|
||||
.flatMapIndexed<String, Part> { y, line ->
|
||||
line.foldIndexed(mutableListOf()) { x, parts, character ->
|
||||
when {
|
||||
character.isDigit() ->
|
||||
if (parts.lastOrNull()?.isIn(x, y) != true) {
|
||||
val number = STARTING_NUMBERS_REGEX.find(line.substring(x))!!.value
|
||||
parts.addLast(
|
||||
Part(
|
||||
number.toInt(),
|
||||
Coordinate(x, y),
|
||||
Coordinate(x + number.length - 1, y)
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
parts
|
||||
}
|
||||
}
|
||||
|
||||
private val STARTING_NUMBERS_REGEX = Regex("""^\d+""")
|
||||
}
|
||||
|
||||
data class Part(val number: Int, val from: Coordinate, val to: Coordinate) {
|
||||
fun isIn(x: Int, y: Int): Boolean =
|
||||
x >= from.x
|
||||
&& x <= to.x
|
||||
&& y >= from.y
|
||||
&& y <= to.y
|
||||
|
||||
fun isSelected(engine: List<String>) =
|
||||
engine.hasSymbols(from.x - 1, from.y - 1, to.x - from.x + 1 + 2) // above
|
||||
|| engine.hasSymbols(from.x - 1, from.y + 1, to.x - from.x + 2) // below
|
||||
|| engine.hasSymbols(from.x - 1, from.y, 1) // left
|
||||
|| engine.hasSymbols(to.x + 1, from.y, 1) // right
|
||||
|
||||
}
|
||||
|
||||
private fun List<String>.hasSymbols(x: Int, y: Int, length: Int) =
|
||||
y > 0 && y < size - 1 && this[y].let { it.substring(maxOf(0, x), minOf(it.length, maxOf(0, x) + length)) }
|
||||
.any { !(it.isDigit() || it == '.') }
|
||||
|
||||
|
||||
data class Coordinate(val x: Int, val y: Int)
|
||||
@@ -0,0 +1,48 @@
|
||||
--- Day 1: Trebuchet?! ---
|
||||
|
||||
Something is wrong with global snow production, and you've been selected to take a look. The Elves have even given you a map; on it, they've used stars to mark the top fifty locations that are likely to be having problems.
|
||||
|
||||
You've been doing this long enough to know that to restore snow operations, you need to check all fifty stars by December 25th.
|
||||
|
||||
Collect stars by solving puzzles. Two puzzles will be made available on each day in the Advent calendar; the second puzzle is unlocked when you complete the first. Each puzzle grants one star. Good luck!
|
||||
|
||||
You try to ask why they can't just use a weather machine ("not powerful enough") and where they're even sending you ("the sky") and why your map looks mostly blank ("you sure ask a lot of questions") and hang on did you just say the sky ("of course, where do you think snow comes from") when you realize that the Elves are already loading you into a trebuchet ("please hold still, we need to strap you in").
|
||||
|
||||
As they're making the final adjustments, they discover that their calibration document (your puzzle input) has been amended by a very young Elf who was apparently just excited to show off her art skills. Consequently, the Elves are having trouble reading the values on the document.
|
||||
|
||||
The newly-improved calibration document consists of lines of text; each line originally contained a specific calibration value that the Elves now need to recover. On each line, the calibration value can be found by combining the first digit and the last digit (in that order) to form a single two-digit number.
|
||||
|
||||
For example:
|
||||
|
||||
1abc2
|
||||
pqr3stu8vwx
|
||||
a1b2c3d4e5f
|
||||
treb7uchet
|
||||
|
||||
In this example, the calibration values of these four lines are 12, 38, 15, and 77. Adding these together produces 142.
|
||||
|
||||
Consider your entire calibration document. What is the sum of all of the calibration values?
|
||||
|
||||
Your puzzle answer was 55488.
|
||||
|
||||
--- Part Two ---
|
||||
|
||||
Your calculation isn't quite right. It looks like some of the digits are actually spelled out with letters: one, two, three, four, five, six, seven, eight, and nine also count as valid "digits".
|
||||
|
||||
Equipped with this new information, you now need to find the real first and last digit on each line. For example:
|
||||
|
||||
two1nine
|
||||
eightwothree
|
||||
abcone2threexyz
|
||||
xtwone3four
|
||||
4nineeightseven2
|
||||
zoneight234
|
||||
7pqrstsixteen
|
||||
|
||||
In this example, the calibration values are 29, 83, 13, 24, 42, 14, and 76. Adding these together produces 281.
|
||||
|
||||
What is the sum of all of the calibration values?
|
||||
|
||||
Your puzzle answer was 55614.
|
||||
|
||||
Both parts of this puzzle are complete! They provide two gold stars: **
|
||||
@@ -0,0 +1,1000 @@
|
||||
7jlncfksix7rjgrpglmn9
|
||||
vcgkgxninerqjltdbhqzzpd4nine23
|
||||
fx3
|
||||
8nrbjbpjpnineseven
|
||||
7qlfhcsnxn7fpfhjcgr6eightsevenjlpchjtzpztwo
|
||||
28rzgskgk94ninefive
|
||||
zdpxcql1eight5
|
||||
8two5six37
|
||||
9khfphjl71trppsrtwo
|
||||
lxthkgbbf2jdcssfiveqksvbqvm8four4
|
||||
seven9tjcgztctxzzttct
|
||||
onetljcfh9fivesvgcqnklz9four
|
||||
4mptgcnzmvvsevenzmjjzhndzdvxmz59bm
|
||||
1hrqthmr
|
||||
7eightqmfmsn
|
||||
jkgdnpzjkzzceighttklsfiveqxgsvxdq4
|
||||
hdk28lqhhttjz6one2
|
||||
2five524
|
||||
363mtk
|
||||
qlmtpch9eightlzddxs7one
|
||||
one6five1hxphtl687rllvb
|
||||
31gdnsxtpnn
|
||||
sqvbcqlnjhk135
|
||||
eightgcdszrsghmmfsevendr2844
|
||||
eightthreecdpccfj7
|
||||
ljfgt9kvnine175kpnrbttktktf
|
||||
zjfeightfive9nine44seven4
|
||||
sixshbrtr4nmjr
|
||||
3two54
|
||||
26sixbhmmgdcl
|
||||
drxfnbsdzf3gnxbtmmggvkxrsevenbbzdfxnrdnkfivefive
|
||||
two8591mrvchg4
|
||||
3jjhfzlnklpvvfcnsjbdmgvlfkeight2snxrkzzsx
|
||||
ztwo79onesix56seven
|
||||
threeeightrhlxptmtwofivenfourthree3
|
||||
fbhcqcttgxlrstcqeight4dbfjp
|
||||
prsevenfournineglccpgssix7
|
||||
hzprzdvbsxzllgvttworstxtwodstxbtjnzm6
|
||||
99sevenfive
|
||||
fdvnvc2
|
||||
vmpnpqg32llcxpbzcxqvseven
|
||||
dc9fgvrvsqqhlj2nq97three
|
||||
four77twothreeonenine9
|
||||
3kfkfour
|
||||
xfg58six8cjtvmrgvsq5l
|
||||
gmfxvhftld2hbmmprpppzchcqmxninethreethree3mmplrvbtkf
|
||||
3fourqndl6
|
||||
rj6ninenzkbktfqsc2
|
||||
9konehdmllc
|
||||
mneightzzqvdm14
|
||||
8oneseventlrsrzflccrbv
|
||||
9vvvgqdkrckjlzcfsbdgrqrhhtbb7fnhcxzmk9nine7
|
||||
825ngddfhpfrsl6
|
||||
mc6tjxxll9seven
|
||||
fxbgccqmmh2
|
||||
five7three4vmxjlqcnc3
|
||||
9mninehkmlpcxqnfkqfbg6six3
|
||||
3onefourrv1ninesixfour8
|
||||
fourtwosdtz817fivevjvlzr
|
||||
seventhvxk1fournqqqfjrvdvbpkvd
|
||||
v733rklzvnslkonefive6zbvq
|
||||
178ncllbfkkh4eightwoq
|
||||
glbxfjhskzbseven6mjzlxccfive3
|
||||
fptwoneonefivefive2ztxpndjdq2
|
||||
lxzhsgqkx5mjxtrmbkdtfeightsrchzmq6
|
||||
1nngc2338ninedjkvszdmnjrl
|
||||
five6six7
|
||||
bcpxbcbssbtmdfninefivesevendtm9eighthxtvxb
|
||||
mzdttqmfpssevensixeight3twoone4
|
||||
rrtzlhkgrgtmrvlcthreeonefour5
|
||||
75threeeight4
|
||||
3ttcjsdrj6one91t
|
||||
3twofgdpfqxxp
|
||||
seven3gjslxpltpbonemt
|
||||
82jcvqkrgzkx8three8rmszgdj4
|
||||
ctwone41fnjksbxb1mxxzznsvg35fivesix
|
||||
four7bzfeight3one
|
||||
heightwo24cxs
|
||||
fdtwone8sevenfour37
|
||||
1sevenmdmlrgmqnnth1mrone
|
||||
7nqxzdrblffcdm22six
|
||||
5ttpzlv
|
||||
zhqjlfive3
|
||||
jvzpgppblkb6
|
||||
nine77lmfour
|
||||
kqnvgtkgphxcxsixfoursix2
|
||||
pjjdlnineltbcknfqvhj8tworbkqhdcp
|
||||
nine65fiveeightjmeight
|
||||
j1sptkfhsczt
|
||||
4czpqqglpc41bzkss1
|
||||
qd28j
|
||||
three1fourfourm
|
||||
four5seven4twodvmzzdtn
|
||||
zj4
|
||||
dzzrdkjjdxspfrjsonefive8brrzlrjvzfour
|
||||
zrjzfxxddn66
|
||||
fourrnsphsdzmv9xznt6seven
|
||||
56eightcbhkmjfourone
|
||||
fivejzlbvqzb3sixsix
|
||||
fiveghfclksgqffdpb7
|
||||
cmmplbcnml36threetrxnhrrdonelmspsbhfd9twonenn
|
||||
ccxrlmzrreightone9three9
|
||||
zg6four1eight
|
||||
1ngv
|
||||
bfhptfjzlgkxtftwo7gthree
|
||||
txrpbzgjzg272three9jlstdb8
|
||||
3seven6twofxvxdlcqj33
|
||||
six3eightjrdxgkrkm5five
|
||||
one67one3
|
||||
gnfhhkffqfctxmvznmftwo34gjsrpxlv43
|
||||
five6zjdjpptnthreefour7sevenqfjlpshg
|
||||
onesevenninesvnnrvxxeightrdbvsbdnzgtmlmf1
|
||||
2six8seven
|
||||
3eightjrpqdrtwoxjvmgzpbffjnfdps9
|
||||
tptlcldftc3
|
||||
lcpqlbjfgmhkjpkhc4eight9ninesixsixseven
|
||||
eightxjfqqtxnsbsnrdxdjv8six79
|
||||
tvkthbbrr8five
|
||||
seven35threerrkdqjgps58two
|
||||
5dln1rqqgdjlcmmrvm2pmhvhcxhfsbxkfqngp5
|
||||
sixnpvbq36514one
|
||||
mxdvxfgdfzmkjcrtl2
|
||||
onejv7lxmbrbzjsthreesevenninesm
|
||||
threehbhnm8nine
|
||||
bvhgqz6
|
||||
9two89sixfxjz37
|
||||
8xninepvggctk85fivefkj
|
||||
8sixdjndzzzrkk
|
||||
five61oneightr
|
||||
cmthreesixeight7jlvdvmdjfzbv3
|
||||
9two1onefour1clxjonetwo
|
||||
9sixtzphqltmeightlbrhjone1ktrvjldff6
|
||||
five68eightfourqpfcxftzlxrhgdcvpd
|
||||
nxvdtfkltwozzl72fourhzxtqjf1
|
||||
91fiveeightthree65twoneh
|
||||
3eight6ninexqqgxzxfgmsixseveneightfqk
|
||||
dlpsfmsthree2zgfpdnftvfqgsgr
|
||||
4kggfpxg8jpxzdqsixeight
|
||||
fivefourtwo923
|
||||
z3gx
|
||||
six4prlsp84tgvc
|
||||
1foursrznv62k
|
||||
vmzr829nkxtlf
|
||||
3dzsx2two7sixfivebkktgfbzdt
|
||||
fourpzpmvxc2zvvrhrbhf
|
||||
frpddtknqjxpqqzhdnfour9sixdqjbqxh
|
||||
89sevengkbeight6mn
|
||||
two7jcpnxhbtmhtwo39twoone
|
||||
cvdqlfkrs821fourrrgnmm
|
||||
6onefhnnbrzgx7fourxcj
|
||||
seveneighthfr6rz
|
||||
9vvqlpnzbxfct8
|
||||
two8three2fpseveneight
|
||||
2three75three2
|
||||
znvbrbrqlfive8
|
||||
lnfjqfkk8
|
||||
14tvvmdlntrv6three
|
||||
5twor2chtvj
|
||||
threetwomgrcfivefive7
|
||||
five4qbvxthrfxdkjkk
|
||||
sixthreethree5scmqrfq4vf3
|
||||
rjsljnqcrttbpfhfxbfourone4
|
||||
threeseventwoseven87dnmqjbbxfoneighttfz
|
||||
seven4four9eightxqlsixthreeone
|
||||
1ninesix43bmsttggvzn14
|
||||
seven1sixbmnxmz
|
||||
grqhlkrcdzbhstgtvpclvtphph4twoseven
|
||||
fgfprscb27pzfvvblxhkvonefive
|
||||
five77fivethreefive3vddgfngng
|
||||
13nllfsevenfour6four
|
||||
threenineeightfour173three
|
||||
fourqvsbxxzmfh2hhcjxsrkz
|
||||
4jdtxgltkkkvlnhrztwofxppsdlcqztwo3gdlctj
|
||||
5four334rvfour9
|
||||
551threenine
|
||||
eightonenineeight8
|
||||
qmjqmjvvfkdbnjgkrqh8two
|
||||
sevenjzqnv32lldmr5one
|
||||
6five8fivefour
|
||||
ljvhqqvqxqsix1367
|
||||
two6kvjtwonenzf
|
||||
2p5chjdcseven9
|
||||
lnrrrkkdsvfhkl9vfqfgnvonegtwo6
|
||||
twoseven4lhhpcvthree4tkrone
|
||||
8hllnnmpm3rjxndcmpt9jfjqng
|
||||
qbnlgqeight2csvjshglqzmgkqqxqzq95
|
||||
two2nine
|
||||
rrpffkq15foureighttwo2
|
||||
five3ninetpx5fmrzsqvfzq
|
||||
mrqhcpgvblhvskv5pdsdzzfzfsix
|
||||
two7fvmhvseventwo7
|
||||
3sixone94three8fdplbm2
|
||||
loneightseveng79
|
||||
fourone7
|
||||
zvgjt1
|
||||
xpgbfghsmj2six8eight8mzlnvmv7
|
||||
grjtwo48
|
||||
jhcgjlgxt1seven1
|
||||
5dhtppxrxcsbjsm37
|
||||
cbhmtp56xbqzppjjfivezhtxxvkrzsix
|
||||
hctwonelcninefourfive2
|
||||
four4rcxpkzbeight95xxdb3
|
||||
fivejlplgzflone963two
|
||||
trgninefourtwo6five
|
||||
66fournine535foursxbvsfvf
|
||||
1bskfour
|
||||
dvlmbrxssevenhldvjxdzcfdvbfourthree2seven6
|
||||
6two92635
|
||||
8dzszone
|
||||
hfcm6
|
||||
dxrfhpdbrqmqq8four
|
||||
bfclp5sixeight81three
|
||||
eightffsqgkmt53gfjxqsskpsfpbcmqvdfour9
|
||||
6sevensevenfour1v
|
||||
9threetfspsfxhnzblgsxz
|
||||
seven5tz7pfhlpt9qxrqz
|
||||
pmbeightwooneonefiveseventft4
|
||||
xhjhmzljnx7
|
||||
twotgdvhkpmg1rthzfc6
|
||||
onesevennpcsbfive9sixseven
|
||||
7sevenmbhlrjxrpddcnl
|
||||
8fsvntpptctwobjmkgzvc4two
|
||||
onetwosix4
|
||||
fourthree4fourlqbvscdponeights
|
||||
1glkfrdb69sixsrvvb
|
||||
ninetwoeight7cvjtdmgpsfivefnlvgsqtstwo9
|
||||
9threejtfoureightseven
|
||||
38nine8
|
||||
87two7onetwo
|
||||
2vkkcgxdqpnthreehklfmfmjdpkz9fivetwofour
|
||||
one5oneone5oneone
|
||||
three5hlxkxrmxsbgrzqsgrone
|
||||
twokbbnbjp7
|
||||
mvxpdllxrvfthreeone51eight
|
||||
rrqvfiveseven5two1qgqppn
|
||||
92s
|
||||
fourxcj8frbvlxzgpvoneone
|
||||
648211
|
||||
4eightgzxnsixlvksllptszztmkjb3four
|
||||
fivegqg6
|
||||
foureightmmnknlseven1
|
||||
83kx
|
||||
sixeight12kskzhrjjpslmprtwo
|
||||
1xzncrsfrlfivetwoxptv46nine
|
||||
fourmxfq6twotwo4
|
||||
oneht8
|
||||
3prjdlrcznine
|
||||
btkpqmxxmggkzftmkxbzqvdccchxdmjlqztzfgfour7
|
||||
tvbstznine9z
|
||||
two1fivemmnlcnmqlrnbp95gjjh
|
||||
dq671ninezk
|
||||
6cmxtt769
|
||||
629rkhc198
|
||||
2fourfiver
|
||||
three5nqkjdsixfrjnf4gcbjrznine
|
||||
xjhqqf7oneeightrgkdprrssmxp63
|
||||
5fourfivekpvmnlpfrt1
|
||||
xnqkjcldhttbpjr8
|
||||
fdntjsb957sevenhbmntp
|
||||
jlmmmmdv482three
|
||||
63lnbhmdhpsp32
|
||||
99cmntldfdflqkfkv
|
||||
kqnlqqkpr9eighteightthree15threenine
|
||||
6threefttghrvjsjg6
|
||||
spmrjzfm6eightwokn
|
||||
bdcjfqvsdronertfztlblqbgfgtkjv8qhbjfhthree6nine
|
||||
9fvltpsxtcbtjxbtlfdvm7
|
||||
6jxvxrdmpjthreefstfgrsixfourzbfznjjlqtjx
|
||||
8onesixkmhgvsnfhqnxlkn
|
||||
rrjxvqjbnvvsgddtvmb3six5
|
||||
eight8sevenbmtgbvdzcpqnzqone1hbhlgcfour
|
||||
2nineseven41
|
||||
8xptgrh1njz
|
||||
geightwo93sevenseventwobpdhhjsrbfour57
|
||||
m4kd9four
|
||||
6nine5seven9v
|
||||
glzc1fiveeightvbmvk
|
||||
ninesixone3sevenzmvrqbtwo4four
|
||||
9onefoureightfivefour
|
||||
fjqpgnjdd1twoninecgsqsmtonenine1f
|
||||
94sixthreedflcddxnvvrthree
|
||||
vvfnbgpkgsnjtszxhrsixfive5rrdtfpkdhdvsg
|
||||
39four1pjfkt
|
||||
45sixkhlfc1fivetcvnlstnine
|
||||
sevenone2seven
|
||||
twofiveonenine6eight5
|
||||
grxzndnqpd56
|
||||
xnpdfnfgt5fivetwotwo
|
||||
9four6two
|
||||
sgmlzbpnkrmfivesbdzbnhkcxndpone49
|
||||
88six2hrmkl2
|
||||
mthree3eightfiveone
|
||||
smrzqc7twothree2three
|
||||
nmtwo8cr
|
||||
378one47four
|
||||
27four
|
||||
5two7seven68six
|
||||
9onecnonethree9
|
||||
nineqhvbjqbrkpjhjhdbpk3twoseven
|
||||
rq4qldc
|
||||
86bqzct2nine
|
||||
eightsnfgrjzhsnxbfivethree6ljxx
|
||||
oneeight1threevzdcplnqrbk92
|
||||
8k9dkqmqhndthreethree
|
||||
9sp6j5two
|
||||
4rsone1seven2seventwo
|
||||
ninehhdcbxfgs7fljclncb6vpzhqphxz
|
||||
drplsnsch3zfr
|
||||
86nine
|
||||
2threeeightsixvzpcqjs
|
||||
dmkhbxsggeight7seven9
|
||||
fourshjlmrbbcnznstgj2sx
|
||||
gcbzbldk6nine
|
||||
fourskpc1vzfxsrjckcmccljtt9
|
||||
1oneone53oneeight6
|
||||
six3fourqxqbs9nkbsixthreesix
|
||||
pmlrkrhqdjgg121nineseven9
|
||||
dmgnq6
|
||||
kpmponeone5
|
||||
mxmhbqnrcjj1threeeightxzfive
|
||||
onebzxnrqqfltfourglvkqfive4nine5
|
||||
threezvmfl7vsdrthsdsjsix9mbrqqmz1
|
||||
boneight8onelrtjkj
|
||||
tqxbbceight9rqbthreek
|
||||
3h32nklscdkfhtztwontprj
|
||||
2threesix
|
||||
qkzmpvkvsixxfzlrfrgv682
|
||||
3seven6mvkeight2fourvhvvqone
|
||||
three389sixeight
|
||||
bx664nine
|
||||
nine82rcdvqtj91dbffscng4
|
||||
2sixsixtbqhvcndjtcvrrbtdzsxrlrvdxjtd7fzdtlrhlxvbpvhknmm
|
||||
6zbpblsznhlzljtmstwothree28ngdcfkk
|
||||
eight8nbfmdqlcvonenine
|
||||
8two4sx7rffstvxlq1seven4
|
||||
gmzbd8nine5nine1one
|
||||
sevenfivezdfbn7six
|
||||
5892
|
||||
ss9
|
||||
8xcvzgzkjcdg
|
||||
1seven7three
|
||||
8four1fourtwonezs
|
||||
hnjzk8
|
||||
xfour5mrj
|
||||
vnkspgtkxspdtwofxlvtlkqpqcffxbqth13cll
|
||||
mmjkshtmtwofour1
|
||||
sixthree6
|
||||
seven9mzmbkkrzsix5five
|
||||
9cbrsqjlhntpzfivegmgn1six
|
||||
bdbnlrdpsninenine3twotwocpvjd3
|
||||
twonine193
|
||||
twothree1twor8cmtxtd
|
||||
bvgtninevfrjs6
|
||||
eightsix8
|
||||
sixfbzsxfjtfv8
|
||||
5onethreeone
|
||||
dgzcksnqz8foursix
|
||||
9onetsrtwotwothreerbv
|
||||
4dnzc8
|
||||
fivenine4sjzsdgvdqsix3511
|
||||
7twofivefivefourqdgpmfblgv
|
||||
oneonelgjsk9
|
||||
zcfhrrpseven8tlffkfnineeightttwoknlfdjpj
|
||||
nine5nine
|
||||
8sixtwotwooneoneeightcdklzjgvnqrsvvkbtfj
|
||||
7one9vxjdkbhqmfbpt
|
||||
6twoeighttwo
|
||||
sixthreesix162
|
||||
5jhxxchf69twosxjckh5
|
||||
sevenxspmvxpmc788one
|
||||
9fseven4
|
||||
vxzqgxbmtgxnm588seventwoqtmfsb9
|
||||
four8nine4ftn5
|
||||
eighteightrhjzcmxql28four
|
||||
twogqjdbmmxqgtxdppchr2xxhcptq2mrvgsdccs
|
||||
six24
|
||||
nqdptone3drgtwoone8
|
||||
threesixnine8hlkrj
|
||||
four7pvvljkscc6hvsppgxrsixknrnrvfjqqfive
|
||||
7tdnbzqqxftqtxjqxgmbdhbvsqdone22drc
|
||||
59rqhzrfrps
|
||||
six1scbkqjd4
|
||||
89blbn
|
||||
lqhoneightthree96tppmhtpmlt7
|
||||
threeqpnsevengfx3
|
||||
sixk27lfjrvhvtsixtwo
|
||||
four5slf8onefournine5
|
||||
ninehgczrdslkstltfive96bqtz5
|
||||
scfkzsr4fournine325
|
||||
5eighthzn9rjdzxllvg
|
||||
1six1threedrfpflhqfour64
|
||||
fivekdtgcdsjxone8nine
|
||||
7sevensevenhronepdgbxvfd5
|
||||
619nine6threetwo6
|
||||
fivehchdssjrlshfqjlptsxghzrcsfcglm4
|
||||
6two73smnqbbmsix
|
||||
84fivermpjpjgkn
|
||||
oneeighteightfhjtxbjc94threefrnnnncdz
|
||||
lrckglbdn94eightqbfxp
|
||||
mtztmbhthzone26sixgjvnbzsjfmthreevqdqrld
|
||||
pnrtpgzcnznfive3eightwogkq
|
||||
threevfpkrjddtpszxddckhftt6txkszsbxnn
|
||||
ninecxdtmdnineseveneight5fivesd
|
||||
xjvv7one
|
||||
5eightfiveseven
|
||||
twodpfdzvqmpzmvs7tpjnpmv5
|
||||
75fivethreesixsfqpzdonefive4
|
||||
4onefive6bsvtplblfbmnjjlb
|
||||
eight75one73pjgdqq
|
||||
ntcnmnkvjzpvxpmb7twokqfour1
|
||||
zd1sevenmgdrgrzvvh
|
||||
65four
|
||||
3kzfztjxjbseven67bnfcntfknlxlv
|
||||
eightfive8xnnkeightfive
|
||||
6three95eighttwonineonevkrtwonebgs
|
||||
92seven2cndf
|
||||
onezxphkcrsix7klrhnhdcxrpz
|
||||
mgl8ldbxzdlgtwo6cdvxbp
|
||||
foursix7lzcddxnjdrfqtthree7six
|
||||
hxheightwoncdcrkczbninefour3lfdtgnqgcnbfxbqlnt
|
||||
2pmcvctfml1one92
|
||||
nineone9eight
|
||||
6crppdpp4cmngqseven3mmv
|
||||
473sevensqpvvhfdrfiventgvmvrhtqx
|
||||
gpnzc1rmfxqgj8nine271
|
||||
84sixtwo
|
||||
frcrtsqhfour3threefivesix
|
||||
bhcvf6
|
||||
seven2seveneightzqmdqhb9
|
||||
28hjjrgqklqgbm
|
||||
98three
|
||||
jqzjntlc541
|
||||
oneq22
|
||||
7fc92ljfmqt19
|
||||
sixzpzkgfiveonezjvrzfdcf43lbqxqseven
|
||||
1two4kfxglzcdjc3dpvb
|
||||
fivembfkfdq6
|
||||
nplrclbrbf5ks6five4hzzbsnine
|
||||
3mkmbgxhn
|
||||
seven9d
|
||||
vnfj8qng
|
||||
eightrgtjpdjjktwo1lphnlrtjfxtvghhbncj2two
|
||||
eight66frbpds5g
|
||||
3one8four9two5
|
||||
9ninefouronefcckhcdfb1mnmdsltdrsix
|
||||
eightsvsix122241
|
||||
3fgpmgxcdqfourkhnrptlktrchfqbxcbbcxvjgznfjkj
|
||||
eighthbhsgrqkgcxtwofour2nzj
|
||||
93xnjrphktk6vshpvnftblggghskg34
|
||||
seven2sixsdvmcfgq64
|
||||
twothreefive3hrmkbmrskcvknineninebnjksp
|
||||
82fourninetwothree8
|
||||
2two158threeninesix
|
||||
hgltdx48onetwofvnsmmsdzjthree
|
||||
k38
|
||||
ninenine4sixctnznsb3tkpx
|
||||
pvfzqtgpntnfhfp47rhllqrlx22
|
||||
815qxtrghrsg
|
||||
5vhfourvdblpninemdzbbgmvsfone
|
||||
nine8nine6four
|
||||
threebcbsmxbks2two5twon
|
||||
kzpsc74qxflxpsix6jgmzgqxvsngc
|
||||
7dbrsmpksixqttqsphqpd7twoeight
|
||||
kffivefourdknzqsevenvkssgvhxf1
|
||||
sixeight5sljd5fourxkkxv6
|
||||
rnsjsmfcbp4twofour
|
||||
zdfour5pktmsmxf3
|
||||
threen42
|
||||
stgtphmjk7onexfour2foursrpj8
|
||||
pjbgtsevenseven7zzhgxlmz
|
||||
sixeightfivefourseven9bpjbcmvkrfive
|
||||
hfhxfqlbqtwo4cdfksbbtlcsix
|
||||
778lkffbzmpdbxjbpfoursdbp
|
||||
tvpjnvtxeight1onefive3nvncq
|
||||
38seven47
|
||||
five8threexqtglzmpmvbzfour
|
||||
nmtsjjfvfzbhpltbbsrjphrnxhr1two3sixvp
|
||||
4gbvkbfqrfgrbr85sixone
|
||||
6mxqltfsxqxnpdrjkxhrp
|
||||
lftdxbhhzvvhpone51six
|
||||
3grhbqf5one
|
||||
six9four94tthree
|
||||
sevenh1bdcgdtmjqhnkzxlkxsevenonecbx
|
||||
jvtwonecfksxckgq6
|
||||
zvmjbthreecbpfdvd6
|
||||
6bsvrsevenbcbcgrrhpxtvbhhfp1
|
||||
sevenfivemtmpcgml9mljnhcrdbfvksvlbpmvhs
|
||||
8nine9
|
||||
mszqdg7jsrcckxn
|
||||
eightseven9zzsixninexhscseventhree
|
||||
eight57
|
||||
4zjpjz26dxnzfb
|
||||
rmcnbnlpd3nine4gngphqfmc24
|
||||
1vvgfxdfourprlmsjmvvtxnn8seven
|
||||
nineonethree6zznkfrcgzvfour
|
||||
gcnjsdlhptwofourtwoonemggshpdh3eight
|
||||
4eightfivenxftjch
|
||||
eightthreeseven94
|
||||
twokvtjgcq992
|
||||
69psqdmgbtljjzjmpsbs1fiveoneggjbbk
|
||||
3k
|
||||
eightsix3seven4twosevenq7
|
||||
jlthbzsc2
|
||||
22nine8jhmktwo5
|
||||
8pzmtnlfptpjckftzrzqsrxkkcc3
|
||||
four33jfxmhcdktzhqvmkxhklxjllx
|
||||
nine3lqcsbmmh4f
|
||||
three514twonellp
|
||||
4qhn5
|
||||
sixbmkxqdgtkbcghvpzonecfmgkpfrxv68six
|
||||
6threeeightjhfsmp8mpvhrjcxzsevenone
|
||||
sevens9two37fjdfrnk
|
||||
jhzpvfldrbmmmglvrkz2ninelbgpdlpdcteight
|
||||
qj9
|
||||
rxfhkkvheightfouronejh8238
|
||||
zfsixvbqngj1vhbvxpfk6
|
||||
vjbqvcm3
|
||||
51six38ngvq42three
|
||||
7zjtcczjz79seven
|
||||
five8fivexxmrn
|
||||
sixseventhree3sixcsk
|
||||
zninefour8tworxkfb48
|
||||
63nine3
|
||||
11eight
|
||||
bxlgdzqthree2ninegqn6kvktfts8
|
||||
tvmzzlpnineztxdbkxgthree1four1
|
||||
gxcnhxone9
|
||||
8eightfive5jkqx
|
||||
qcfgbpgdveighteightone7seven
|
||||
86eight2five
|
||||
tftbbfpsvhtwo8eight8seventwo2
|
||||
skfp8
|
||||
8hdlhh4ninenxllmthreefivebhslxkvtcp
|
||||
sixbmljnmhseven4sevenmsfbsbqlzrrseven3
|
||||
v1828
|
||||
6seven53hhtj
|
||||
five51lkfsrm2
|
||||
bvnrdvjnxjbfv9prx
|
||||
tqbnxeight6hztrsbvronethreethreeqvh
|
||||
pcbjr3cjhrqxbcvpzdmfive6oneightgt
|
||||
qdeightl6four
|
||||
ncprx96ninegn3
|
||||
sevenb4eightwonr
|
||||
qbslkmkqlf8ztzeightpcn
|
||||
fiveeightcpn7hvxmtpcsbqfvpnmvgncfbpxzhfive
|
||||
3rxxcqhlp4five
|
||||
threefouronevdbdmktp17
|
||||
sixdtmnlhth9onefive
|
||||
fouronelxgxpvtmseven2ninesix
|
||||
eightrfxrkcfive21ftlcgdcrmbsnrr
|
||||
nine1fourfourxkppvqrxfdhsdphjcgnhnfnzlld
|
||||
562
|
||||
4sixhj4eightzkbfpdrtzcsp2
|
||||
ddfdbdqzfshfxnseven6onetwo2
|
||||
five915b3
|
||||
sghrbfzmmrrbnone9four5rkmqgh
|
||||
threedmmsdvgs6twotwochp
|
||||
seven1fivesixnine9four
|
||||
6dvmgsjcfour3q
|
||||
cschsrvz3nkk
|
||||
4fnqmnd4rnxbjvcbxpchfour
|
||||
3eight9
|
||||
tboneninerzhsgqqcxd2gxhm2mhdpkjeight
|
||||
vpsbgmzbjk6nineeight
|
||||
sixsjbzldfive6
|
||||
qjprfk1eight7vbdshhnfive59
|
||||
dbxdgt6
|
||||
pdgghktdjhsxnblgpzmtc24onecmctldqtsc
|
||||
bgfzght2szvttsdndfiveqgns3
|
||||
6ninebdnbxzmeightfivevff8pdllfour
|
||||
four2nineeightvfeighttwo
|
||||
fiveone3sevenhfqnfbjg3five
|
||||
eight19two
|
||||
fqkeightwosvszgpjvbl2xtmgmc6128six
|
||||
6five6one24fivemcgpx
|
||||
pmvrz6threemlhoneightdjf
|
||||
7cxrgxx53gksgdsv9
|
||||
six3two
|
||||
nfqffqrvkvhqfzthgxp3fivesix7gb
|
||||
nlqdkgllxdvgj8xdhdfnnnfive
|
||||
fournine1nineseven
|
||||
four35djzxvsvvdfxbnhsixfouroneseven
|
||||
9fourhntsmprtddm
|
||||
fourfsix81sixvxmz8eight
|
||||
3pqngffjxqpntqtl8zz4
|
||||
five325ninemfqxnseven1
|
||||
1one2gqx3
|
||||
hqsfive67rr3q4
|
||||
onefblnbfvzlzthreenine1
|
||||
96zsvdl2
|
||||
1fourjjhf1tn18
|
||||
sixfdpljnbpzxlvhncjs9threefckbgtcm
|
||||
seven6ffmvnnmxl8fxskzvpfs
|
||||
5tgbqdkfive
|
||||
52czvkbqgztwo17ninesix
|
||||
bmshtrzdcmkfour5
|
||||
nrfn25one
|
||||
9two4plklcqzjftj7
|
||||
onedks4five6hdllqssixbssl
|
||||
2xftcfnd2twotwo
|
||||
rzxzkcdtnmsbhnncltpj62
|
||||
6snszfour
|
||||
398seven58
|
||||
vstfive8869
|
||||
1fivesevenvgjrlqqlthjz1
|
||||
tpg7eightseven
|
||||
gqvpptsix356
|
||||
7nineone9fournineeight
|
||||
tr1threenine
|
||||
tvz8xconeightfz
|
||||
two11five1nine
|
||||
jntkxfvt2threegseven3
|
||||
b69ztbtgmqfntdnine4two4
|
||||
threedsgrrfcpzpfivebrpjhzfhs96gxmfhkhfive3
|
||||
eighteightthree5crdbzgqvtxx6two
|
||||
nine4onepxjtmbhrpklmlhcfspxrjdnd
|
||||
7fivetpttvnmgzd
|
||||
8lmddfzjeightxxvvcvp
|
||||
loneight1three4dmzxqncjbninerbsrjxxlsb
|
||||
657fourdjkhrlxjdp3ninepvlqhz
|
||||
three4threekddjrfsdk3
|
||||
8xbjcnsjq89
|
||||
six8ninesixfourpcsfhnsxgrz
|
||||
8twosixmvhmsps3
|
||||
six9sixeight
|
||||
4seven175
|
||||
4twomspqqn6929
|
||||
71seven9eight
|
||||
4znc92eight
|
||||
ninetwo2blcllflxonezljhhsfivelngxk
|
||||
nmbrjnsqhkxzxhmxsix1oneeight5fourseven
|
||||
42kvzlcdjzxmgnpqmsmkxq3seven43eightwovms
|
||||
rj5hxkldqseven
|
||||
f7
|
||||
5sskjblmnbzjhctvmttwotwott
|
||||
9ftmpxlbphsfxzsbktjttkxclknsbkftwo7
|
||||
3ndmzlfbsfqhxrlj2fourfive
|
||||
8378vkthreemggtf2
|
||||
2hprlpkbsfzbnbpsmflxjh15one
|
||||
dxvtfrhhxthree68four529eight
|
||||
xgjvjddtnine1zxeightwosnx
|
||||
sixblpgkznvjseven2oneskvxgngzlpzvjcxkcjgblh
|
||||
bhhkfive4jgngngjfhbp8kpnjtgrmblone
|
||||
8vmfivetwo9eightthreefxbvf
|
||||
8738
|
||||
8sixlgnpbpqpltbqqjjxpkcdfourhxzqpmm
|
||||
seventwo5three
|
||||
h46ssnqlfrl8
|
||||
ninetwokrkfqhh2jbznndtchssjtbpqdhtnrhsix
|
||||
254
|
||||
1nhbdtwosixonezxtnvhjnine
|
||||
qxx97d1dcnqzqhsixnzbrvrksnc
|
||||
fivegnxzgvmzone8fourfivethree5
|
||||
fivexhx7six87
|
||||
zngqzxpmd63bgfzjpftsjgzghdppqfqbnblt7sixone
|
||||
ninemzlgnkglj1
|
||||
fiveninesixeightthree4six1
|
||||
fivesix5ninethreeqkxczhp3
|
||||
eight19two16pqdstm
|
||||
mplj637sjtgzltwo
|
||||
7lvs7xzmjmxjhlgdqhtqllhtzlkmbfm5
|
||||
six6kqvbjfoureight94
|
||||
one9qdjpfszz6vxbrdnntfz8btft6
|
||||
65onendmdgtr
|
||||
seven368
|
||||
eight31ngsdmnm
|
||||
2threetgpvcseven
|
||||
nine297zqgvglthreel
|
||||
7eighttxvrbjsnbcseven
|
||||
rdpcnrscggv1cxv63
|
||||
2cdfltscsnzg8eightwosg
|
||||
jrszpsjthree8n8bdjtlcbxtsixktkcc
|
||||
dns3
|
||||
2threebpkctf
|
||||
5pgzpfqntc
|
||||
9pkone
|
||||
oneseven2fm545two3
|
||||
9threegtctbldnnclqpdmjnps7seven
|
||||
1dknxbdcvpssix413
|
||||
rzrvm77one2
|
||||
sixnttfive97jdcjvcmg
|
||||
spdmkhnthreebqsmtqgnm5threedxjcvsrxbq
|
||||
btzkx8ckninevffmmfm3four
|
||||
hgx8fivenine2oneightc
|
||||
thdfczcpnxctgfiveseven65threeeight4
|
||||
five6nine
|
||||
qgtds7
|
||||
hqnzcfleight8two2
|
||||
8q8zbkjrqxzhlzgmqmzrbfqceight
|
||||
nbbrrmksdm2ninefive3x
|
||||
fivec2sixsixmngbsjzk71
|
||||
821one4
|
||||
5eightvpxfpnzvsfhcdtn7kdkjdpsqcl
|
||||
6seventwotwogxvgvxzjbvcqcl38
|
||||
onetwo23863
|
||||
24qtzzxfhq
|
||||
one7six814
|
||||
czdhrn2twoninetwo8
|
||||
one54
|
||||
foursslpnrqcv7sixtwoned
|
||||
9xsptsgfplpbrtpc1sevenjrggpr52
|
||||
zoneightg6sixgfdtwo7
|
||||
34twodhthree2tqsevenvqqrxq
|
||||
monektltrghq97seven
|
||||
ggeightwothree5cpfvrnp48
|
||||
nine7zpcbx33bbmd
|
||||
six831
|
||||
63vjlqdc5one
|
||||
nine9cgxgrq8
|
||||
5sixxpeightsix
|
||||
onecgpxlhhgtthreetwo3
|
||||
336
|
||||
xcdjlblthreefourqrcxbxlhsdlseven5five
|
||||
9znnlhrrmb1999drzkckthreehghffcgfr
|
||||
two8one
|
||||
ztwogggh48
|
||||
six4pcmqkpqb
|
||||
14two47vmhbsgrgdone3
|
||||
84eight2
|
||||
5cnoneskjzppm
|
||||
nine8threecstfxqp7
|
||||
threecsbhnn22three9three4xphcvgnz
|
||||
vjq8ninenhr7
|
||||
qcffmrfthreexgjjrdbdthree3
|
||||
eightsix5
|
||||
threeeightfcsmrvdqzp6
|
||||
sevendcpm3five4eightbthreefive
|
||||
kq9one46dqnr
|
||||
jbmtdqbzn5sixlnthree
|
||||
ninebdz4fourbvq
|
||||
phbzxtvtthreerm89
|
||||
dqlgfoursix5k3mcrkmxcp
|
||||
3fivesixqrrvtsjdxtdqp14pznxpnrgkrvg
|
||||
5cnkfz4lxbvbpmcfninetgn9
|
||||
mtjq8threeninefourhnzgctvtrfive
|
||||
47l6784
|
||||
twopdmponenzpjfbqgt2nine1qccqx
|
||||
77hspkdhqfztwomkdshrkn3nt
|
||||
five7pjrslqhkzcjzhn6
|
||||
twoqvgphqs8zzmgclhsseven5eightfive
|
||||
threehmkjmrqqblnrfvbpzhrsix4zvlmcqeight
|
||||
6lcfjthree8ninefive54
|
||||
sevenfive558four
|
||||
htbdrfh8bthreeninedrjdbjbzlknine
|
||||
hkhknzrbfsevenhcvbdfs2sixcbjqzltfour4
|
||||
qrvfpxdseven2
|
||||
139msnzkfgpzdz5nine1
|
||||
rbdone3ftvrdkssvmnzjgpcbdjzdkcgbcs69
|
||||
nine58
|
||||
2ckxdtcqc5seveneight4two
|
||||
qtgndtm4mrqvtgbgjf7nzhvtvjqqrdmfiverzzgn
|
||||
3rchqn37tlvgtftdjqxgbvhlpclpneightfive
|
||||
11sfhcntjzpnkvpzjfhhpmbtjptngpnbqthreethree6
|
||||
fivenine4cthreeeightzqlckkvs
|
||||
5threekjqxkddgvzph92
|
||||
five372seven8eightthreefour
|
||||
fivegjjxh15zdnbxzlhleight5fourqrpxj
|
||||
84sevenvckrdpxlgzkcbpr76fjzbpn
|
||||
mvvxgjfqj9five1psvtflxhkpfourdxzxhvxmthreekp
|
||||
seven7pnltbp1twotwo9lfdgzpj
|
||||
sevenfkrtsgrnhgfive54three8csmsg
|
||||
sevendczlbgjbg6srsbtseven
|
||||
onejscsevensix2oneightd
|
||||
mchrcflvfj3znrzhrvbhm
|
||||
brfninexxntnine83kfzbn
|
||||
97tfgthreefxpv
|
||||
kspdrcnvvntts8bb4sixvghhjcpt
|
||||
8onedxcbnlvpntljztxs
|
||||
c91drttnrsevenxj9
|
||||
9onethree9fivexrszjfxcrjdbskdmn
|
||||
cjtnzpfourxspsjvmrbqclkzkdftc8pdfbfxjnvflgfkqctvcsc
|
||||
5seventkqrdpmrrchxfournczqzlqqm7p
|
||||
nhpbdxgzzjltdftqc5fivelgvjshonervrxmgscvhnnfl
|
||||
2gcqpdcgjv
|
||||
bqhzdzxb54
|
||||
nsmxljkjcmnmxvcrj7threegcrjs7
|
||||
2cninev1eightdjcztnrk
|
||||
cmjskeightmjfrlfhm22fivetzmfive
|
||||
8ndsix
|
||||
nzrgmlcrg5r4eighthfxm4
|
||||
threeptlf3x4
|
||||
3bhd
|
||||
cbmzrtglngmghmonezdqnhxxd1ctpghbfzqfivefour8
|
||||
eightpdzftbdlcrtwonine29bcgxflmf
|
||||
69crzsmjfivecxcqtffoursix4two
|
||||
92zghnv
|
||||
fivejmdxvnf1
|
||||
1ntvtnrjmeight1onegckvcnsjnthree
|
||||
ncxgppbsnhsfnhlonelfbxqzsgfjj8
|
||||
eightfhjbrlzxcgtls42sixtjk7two
|
||||
czrtnfzjnjhxdxtbgtmntkcpninejtzrprsstm4eight2
|
||||
483nine
|
||||
onecnxpmhjjcvdtzc71seven
|
||||
5l15
|
||||
19jmkmrxbdbtz4shpdgmmhzrxtbftpgrj3plvlqdvnr
|
||||
two4two
|
||||
kqgtjstcpnhf8
|
||||
sn6
|
||||
grtgjxgqhv2fourbjmfnb
|
||||
bfmtkqfcp5hks74fivesevenbgvgzr
|
||||
peightwoninef2ninejmlhndvjd92
|
||||
1qxm
|
||||
2drkgnvghqrjtfxrvnthreesevenpzzldp
|
||||
four4zcmmzgbzc
|
||||
4nfbpctgmx
|
||||
3threemfbgthree19sixone8
|
||||
ggc1gldjhxsgvq
|
||||
1four4seven824nineeight
|
||||
ninefour6one5ninetwo
|
||||
bpjs8rjdxpm
|
||||
zggcvkzeight7onejgkhpsrdkfvfx5three
|
||||
7h7lpjzsdv4six1
|
||||
6seven9one4
|
||||
sixfour6
|
||||
4hkddrmgfp
|
||||
43ninecrtoneseven2qbhkkbzdltfour
|
||||
85
|
||||
hlfive3dqzdvjkdd
|
||||
5chpcxbjkrdzbjtwofivethreem
|
||||
6ninenineonefour
|
||||
5five8twoonesf2
|
||||
four1seven5pbbjgmxgxmvfzjtvr6vttbnd
|
||||
zzkcpcckmsixeightnine4
|
||||
9xxzzvcsg45one
|
||||
xmd3ninerxllskrl
|
||||
xxj2onesixfive3six
|
||||
threeseven8
|
||||
one43
|
||||
1sixthreelcbcfgbone3bzgrl5
|
||||
four12535three5
|
||||
jztxrtwo8495
|
||||
threeqhsvcvzfnsevenfourtwothreeffrz9
|
||||
onevqlxcz461five4fthree
|
||||
znine5
|
||||
cch5ptlbcbh2ngnlqnrdsjv6mfhndf2
|
||||
threehblbzlddttzkrsl51eightzrj
|
||||
68pgmnbz7seven
|
||||
twotfhcgltpp1ntpcvrmkgd998
|
||||
seven3fourfive7eightsevendlqqseven
|
||||
jqtcrf43zkktbqhsevendljgb5two
|
||||
3one5threethree
|
||||
vvpjcnine9seventhreeninebtzmr
|
||||
jfourp7twoseven32
|
||||
2prjqnineninevjlmqkrkdxv
|
||||
67six1oneddp9
|
||||
tcbcttxninenine21hrmphqrjkvtnfgchjnb3
|
||||
sg1six5sevennineone
|
||||
ninet7jkrzxtmmz
|
||||
ninesixtslvqck9
|
||||
dnhsp9sevenrrsjdn
|
||||
onekqkvb7
|
||||
2sfflskftk
|
||||
79four
|
||||
jnngdkghtwo1two
|
||||
fptfourseven4hjvkz3onesix
|
||||
tzhtsgkcp8
|
||||
9n
|
||||
six4294seven8
|
||||
seveneight74five1
|
||||
kfghjdssttgrfour2two5three1nine
|
||||
5gkhgsixvlpcdmpgbjkqtjlthreetwo3one
|
||||
sevenfour1tfxzgsnldk1fiveqg
|
||||
187qhhqlrjx
|
||||
2lthreethreexthjqcsix
|
||||
cgpxkxgkmcpdzhtpc363
|
||||
sixbtkvqt3
|
||||
4twotwoqqmtb7dczgqrtsixseven
|
||||
seventwo7z9fzgjkl5fjndrznc
|
||||
qsgfnjqsghtwoninethree8lppsthree
|
||||
threesevenkdzzvzbl2foursxrlq4sevensix
|
||||
seven8bjbmcnhrcp3one
|
||||
gg531
|
||||
one8sfvzplxlknine54
|
||||
dlxeightwo48fourthreeninethreeeight
|
||||
sixxlglqsjtmqmgcnfvpljsevenqlgllg6
|
||||
tszncfour7one
|
||||
three54three4
|
||||
qkjxzcdmxqvjngmrkpmleight83
|
||||
5twoksv49
|
||||
7six58sseven87two
|
||||
fourseven6ndsgfjv8
|
||||
ppmclkxhpjpqrjoneeight8two
|
||||
538
|
||||
sixlhsixfive5
|
||||
twosevenb3f2twonebpb
|
||||
lxqbgl55fgzfmvtpgjbxxgffsixlkxlbvmjkkslqpkq5
|
||||
7ptnpseven6one
|
||||
3mtlbfc6tx46five
|
||||
99pgdmnrbjv
|
||||
7twokvzlvptxcrfbfzqsxsqvxtfkcpkczkr9fjxsr
|
||||
eight82lfivenine
|
||||
onetwo2jvqdhkktbeight
|
||||
8zhxksgcc79one
|
||||
knqqz4
|
||||
36twofour
|
||||
2gdssixtnineeight2
|
||||
foursix4
|
||||
49hjbscbjvbckhjmjrdbh3one
|
||||
fivesixdqpnv2
|
||||
7ftwo
|
||||
fourffhffkphssbxzsgeight68dvhgrb
|
||||
two8sevenfive1
|
||||
dggljb5nvhpspbscfhd21
|
||||
twokeightthreeone6lqglrseven
|
||||
cklfcsqgtwohptslmlgdpjktvvbbx3
|
||||
two3sixthreesevennine
|
||||
7ninepnclmdnv7ninevmqoneightpct
|
||||
czzbhfhhrfonetwo1ttvpgxkgsonektpnfrptjltklj4
|
||||
7sixthree1five45
|
||||
btwone3fivelfzmfxsr81oneqhkzjvt
|
||||
5kmrlbvpcdrfivefourfive3
|
||||
9fsl3nine12
|
||||
1seven1seventwofivetwosix
|
||||
sixzdeight9fcpzvsbtz85
|
||||
n1jmxjvgfiveone
|
||||
1qsptpfbqtrl19three
|
||||
5twoeight3grrksgjdkgn
|
||||
1dq4sjknrp755
|
||||
2three2five
|
||||
txktfive2ngqfl57
|
||||
vnrjvh1qpbbzqlgjpgrsgrqgggthreeone
|
||||
sevenone8srlxqqlvv
|
||||
eightsbfivefourfourseven6
|
||||
853
|
||||
eight53b3sxfvnz7
|
||||
qbhrhkhcbnsfivenszghnbhsix2ggvv
|
||||
two28three9
|
||||
rltzcpbqxfive1nineone
|
||||
5threedcfspjkm62seven8
|
||||
tlndznhtthree268
|
||||
ndfgfkphmn2sixjxxtlbqlnine
|
||||
51eight682fivepnine
|
||||
dqvrvthreesixsix2fivenrjeight
|
||||
seven69
|
||||
4qlkktltwo8tqgxcninefour21
|
||||
threefour32j
|
||||
4nine27ngxp8
|
||||
seven5ghxkb8
|
||||
nineone56
|
||||
two8onezonesctsttzt5
|
||||
64km6ttncd
|
||||
three6six6
|
||||
threetwoeight7six7jgmhreightwocl
|
||||
3sixfivehjgvqjlrsfivesix6
|
||||
fiveeight3sppjtccnineeighteightnffgtlsdj
|
||||
12seven9fbqxhs9jgh4five
|
||||
7dmbqrqsnckxtpt
|
||||
ktvlgfzt95lfdvf4lbppfccjcprdpkdj
|
||||
seven65lrjmmqdfjfourtslnhdh5
|
||||
sblgrkqccmpqhfksmg5532
|
||||
rgqzkmmv4ctgzcgvqdghmvfour3
|
||||
24rtxdxqnbvdnkgtgcbfkfbtwo
|
||||
63seven78hrdnnsh
|
||||
eighttpj79
|
||||
foursix6
|
||||
6czcdgdmrmzcdcfmsixfkdnbdsplcscqh27
|
||||
3333dgrd
|
||||
8threeltfpfz3
|
||||
xgxddj3qkcnbbbhtvbzkmvh8
|
||||
s2pzqkldrcx43xzmxqvspm
|
||||
eight1gkvlt24twothree19
|
||||
lkrzltxknd5fmjgbds2klkfgcgp3xcbxxpnl9hzfbfclrx
|
||||
2zhn73
|
||||
sixone4eightninelthreeeight
|
||||
seven8vlqqfjfmltwosevenfivetwo
|
||||
spfkzfmssfjrsevennine8ltlrnrjbcfive8
|
||||
1spbthreeshsgmrbcp
|
||||
ninefive7cnxznfmcp6nine
|
||||
eight4one9x3nine
|
||||
eightnine4kgxhxx1ckrqlrn
|
||||
6sevenkjmfxrbhck
|
||||
jsgtwonefvmcdsnqfp4fivefivesevenhkbkqcb1vgkshfnxfc
|
||||
eightcvzmtlvsm49
|
||||
78four
|
||||
threeoneninecjzs75
|
||||
xrxrsrh58
|
||||
1zqkhcvoneseventwohbrfbqgvp
|
||||
9zfznrfvtgjfhsk
|
||||
v5jcblbstnvxk
|
||||
6s1
|
||||
6three1seven
|
||||
75xpmzmhqqphgtrblhkcdxczcvbmg
|
||||
2rqv989fourthreefourone
|
||||
zmghjgrfqlzpdcqq9fjnkbl7btgf
|
||||
2three3qvbfbn
|
||||
fivehnklrqktnqqlqfslfjpfpfx9six
|
||||
3xvskqbjzrlonetwo
|
||||
95fx6sevenseven3grfncsdttt
|
||||
two8twoklgnrm
|
||||
two9seven6eight
|
||||
7lh2sevenshfvljtphhnbhvkzxxgjjrvlq7
|
||||
ninemdgkndsevensevensix4seven
|
||||
4three6eight1lkdmtbh
|
||||
7rdpvbqljvnine82pmqclfive
|
||||
nine6nine7seven6
|
||||
54rvpqphbpxmcfjmcspsnhrjp
|
||||
eightn2skzmpmtgqhvvfxgqonevtbfsmfklzspxdrgj
|
||||
nine276rzshsrvncjrdzfxbmzzlvkhdlcc
|
||||
sevenfivexgznfftgthree44
|
||||
fivekltdkmm3rdmdnm32nineddsfdzpks
|
||||
@@ -0,0 +1,27 @@
|
||||
--- Day 2: Cube Conundrum ---
|
||||
|
||||
You're launched high into the atmosphere! The apex of your trajectory just barely reaches the surface of a large island floating in the sky. You gently land in a fluffy pile of leaves. It's quite cold, but you don't see much snow. An Elf runs over to greet you.
|
||||
|
||||
The Elf explains that you've arrived at Snow Island and apologizes for the lack of snow. He'll be happy to explain the situation, but it's a bit of a walk, so you have some time. They don't get many visitors up here; would you like to play a game in the meantime?
|
||||
|
||||
As you walk, the Elf shows you a small bag and some cubes which are either red, green, or blue. Each time you play this game, he will hide a secret number of cubes of each color in the bag, and your goal is to figure out information about the number of cubes.
|
||||
|
||||
To get information, once a bag has been loaded with cubes, the Elf will reach into the bag, grab a handful of random cubes, show them to you, and then put them back in the bag. He'll do this a few times per game.
|
||||
|
||||
You play several games and record the information from each game (your puzzle input). Each game is listed with its ID number (like the 11 in Game 11: ...) followed by a semicolon-separated list of subsets of cubes that were revealed from the bag (like 3 red, 5 green, 4 blue).
|
||||
|
||||
For example, the record of a few games might look like this:
|
||||
|
||||
Game 1: 3 blue, 4 red; 1 red, 2 green, 6 blue; 2 green
|
||||
Game 2: 1 blue, 2 green; 3 green, 4 blue, 1 red; 1 green, 1 blue
|
||||
Game 3: 8 green, 6 blue, 20 red; 5 blue, 4 red, 13 green; 5 green, 1 red
|
||||
Game 4: 1 green, 3 red, 6 blue; 3 green, 6 red; 3 green, 15 blue, 14 red
|
||||
Game 5: 6 red, 1 blue, 3 green; 2 blue, 1 red, 2 green
|
||||
|
||||
In game 1, three sets of cubes are revealed from the bag (and then put back again). The first set is 3 blue cubes and 4 red cubes; the second set is 1 red cube, 2 green cubes, and 6 blue cubes; the third set is only 2 green cubes.
|
||||
|
||||
The Elf would first like to know which games would have been possible if the bag contained only 12 red cubes, 13 green cubes, and 14 blue cubes?
|
||||
|
||||
In the example above, games 1, 2, and 5 would have been possible if the bag had been loaded with that configuration. However, game 3 would have been impossible because at one point the Elf showed you 20 red cubes at once; similarly, game 4 would also have been impossible because the Elf showed you 15 blue cubes at once. If you add up the IDs of the games that would have been possible, you get 8.
|
||||
|
||||
Determine which games would have been possible if the bag had been loaded with only 12 red cubes, 13 green cubes, and 14 blue cubes. What is the sum of the IDs of those games?
|
||||
@@ -0,0 +1,100 @@
|
||||
Game 1: 1 green, 2 red, 6 blue; 4 red, 1 green, 3 blue; 7 blue, 5 green; 6 blue, 2 red, 1 green
|
||||
Game 2: 1 green, 17 red; 1 blue, 6 red, 7 green; 2 blue, 4 red, 7 green; 1 green, 6 red, 2 blue
|
||||
Game 3: 6 red, 15 blue, 15 green; 1 green, 4 red, 12 blue; 14 blue, 9 red, 1 green; 2 red, 15 blue, 12 green
|
||||
Game 4: 8 green, 10 blue, 6 red; 20 blue, 4 red; 17 blue, 2 green, 3 red; 4 blue, 2 green, 3 red; 10 red, 3 blue, 3 green; 5 green, 14 blue, 6 red
|
||||
Game 5: 3 green, 8 blue, 2 red; 11 red, 6 green, 11 blue; 8 red, 5 blue, 2 green
|
||||
Game 6: 2 blue, 12 red, 2 green; 3 green, 2 red; 3 green, 3 blue, 10 red; 7 red, 2 blue, 4 green; 1 red, 2 blue, 5 green
|
||||
Game 7: 1 red, 8 blue, 2 green; 1 red, 2 blue, 12 green; 1 blue; 3 blue, 3 green
|
||||
Game 8: 10 green, 4 red, 4 blue; 12 green, 1 blue; 1 red, 13 green, 2 blue; 12 green, 3 blue; 9 green, 7 red
|
||||
Game 9: 1 green, 1 blue, 3 red; 3 blue, 3 red, 8 green; 6 blue, 4 red, 6 green; 2 red, 7 green; 1 red, 10 green, 13 blue; 5 red, 1 blue, 1 green
|
||||
Game 10: 9 green, 3 red, 3 blue; 12 green, 2 blue; 18 green, 1 blue; 14 green; 2 blue, 9 green, 2 red
|
||||
Game 11: 14 green; 2 green, 2 red, 11 blue; 9 blue, 3 green
|
||||
Game 12: 9 green, 3 blue, 8 red; 1 green, 2 blue, 3 red; 4 blue, 8 red, 10 green; 3 blue, 7 red, 8 green; 3 blue, 5 red, 7 green; 2 blue, 5 green
|
||||
Game 13: 6 red, 1 blue, 10 green; 7 red, 1 green; 8 red, 2 green, 1 blue
|
||||
Game 14: 2 red, 4 blue, 2 green; 2 green, 5 red, 1 blue; 1 red, 6 blue
|
||||
Game 15: 7 blue, 3 red; 13 blue, 8 red, 1 green; 1 green, 5 red, 13 blue; 8 red, 5 blue; 4 red, 3 blue, 1 green; 12 blue, 8 red, 1 green
|
||||
Game 16: 5 blue, 1 green, 2 red; 2 blue, 20 green; 4 blue, 1 red, 17 green; 10 green, 5 blue, 2 red
|
||||
Game 17: 6 red, 13 blue, 8 green; 12 blue, 7 green, 9 red; 19 blue, 5 red; 2 green, 8 red, 14 blue
|
||||
Game 18: 5 red, 2 green, 1 blue; 8 blue, 17 red, 9 green; 2 blue, 1 green; 4 blue, 10 red; 5 blue, 4 red, 6 green
|
||||
Game 19: 5 red, 12 green; 8 red, 13 green, 1 blue; 1 red, 1 green, 3 blue; 5 green, 5 red
|
||||
Game 20: 11 red, 8 blue; 9 red, 2 green, 13 blue; 2 red, 1 green, 2 blue; 1 green, 9 blue, 13 red; 3 blue, 5 red, 1 green
|
||||
Game 21: 1 red, 4 green, 11 blue; 3 green, 15 blue; 6 green, 7 red, 14 blue; 15 blue, 6 green, 10 red; 6 red, 16 blue, 2 green
|
||||
Game 22: 2 blue, 15 green, 2 red; 3 blue, 6 green, 1 red; 2 blue, 5 green, 1 red; 6 green, 2 red, 2 blue; 4 green, 2 blue; 4 blue, 1 red, 15 green
|
||||
Game 23: 2 blue, 1 green, 12 red; 5 blue, 11 red, 4 green; 12 red, 4 blue; 12 red, 2 green, 5 blue
|
||||
Game 24: 4 blue, 7 red; 3 red, 3 blue; 1 red, 4 blue; 2 green, 6 red, 6 blue; 7 red, 1 green, 2 blue; 6 red, 1 blue, 1 green
|
||||
Game 25: 5 green, 9 blue; 6 green, 7 red, 2 blue; 1 red, 3 blue, 7 green; 9 blue, 3 red; 5 green, 9 blue, 2 red
|
||||
Game 26: 6 red, 4 blue; 2 blue, 4 green; 3 green, 5 red, 5 blue; 4 green, 6 red, 3 blue; 4 green, 7 red, 4 blue
|
||||
Game 27: 15 green, 1 blue, 12 red; 12 red, 1 green; 1 red, 1 blue, 5 green; 13 green, 6 red, 1 blue; 5 red, 1 blue, 1 green; 11 red, 14 green
|
||||
Game 28: 3 blue, 2 green, 10 red; 5 blue, 2 green; 4 green, 3 blue, 11 red
|
||||
Game 29: 10 blue, 2 red; 17 green, 7 blue, 2 red; 1 blue, 8 green, 1 red; 10 green, 2 red, 3 blue
|
||||
Game 30: 10 green, 8 red, 1 blue; 4 blue, 7 green, 14 red; 2 blue, 14 red, 11 green; 1 blue, 13 green, 12 red; 5 blue, 2 red, 4 green; 4 green, 5 red
|
||||
Game 31: 4 green, 11 red, 11 blue; 3 blue, 11 red; 5 blue, 7 red, 3 green; 10 blue, 5 green, 1 red
|
||||
Game 32: 4 red, 8 blue, 1 green; 14 red, 7 blue, 4 green; 13 red, 3 blue, 9 green; 3 red, 1 green, 8 blue; 8 green, 8 red, 5 blue
|
||||
Game 33: 6 red, 10 blue, 7 green; 19 blue, 1 red; 6 green, 11 red, 11 blue; 2 green, 2 blue, 12 red; 3 red, 13 blue, 7 green; 6 green, 4 red, 2 blue
|
||||
Game 34: 3 red, 3 green, 15 blue; 7 green, 15 blue; 3 red, 2 green, 8 blue; 19 green, 18 blue
|
||||
Game 35: 2 green, 1 blue; 2 green, 2 blue, 1 red; 3 blue, 1 red, 1 green; 4 blue, 1 red
|
||||
Game 36: 1 red, 11 green; 1 green, 1 blue; 8 blue; 2 green, 3 red; 1 red
|
||||
Game 37: 4 blue, 3 red; 12 blue, 13 red; 2 red, 2 green, 8 blue
|
||||
Game 38: 8 red, 2 blue; 1 green, 2 red; 8 red, 2 green, 1 blue; 16 red, 2 green; 7 red, 2 blue, 2 green
|
||||
Game 39: 6 green, 1 blue, 5 red; 14 green, 8 blue, 6 red; 8 red, 10 blue, 1 green; 14 green, 9 red; 17 blue, 5 red; 1 blue, 7 green, 1 red
|
||||
Game 40: 4 red, 8 blue, 3 green; 13 blue, 1 red; 3 blue, 7 red, 3 green; 3 green, 8 blue, 10 red; 3 green, 20 blue, 5 red
|
||||
Game 41: 1 blue, 2 green; 11 green, 2 blue; 5 blue; 15 red, 8 green, 5 blue
|
||||
Game 42: 1 green, 12 blue, 1 red; 6 blue, 1 green, 5 red; 1 red, 11 blue, 4 green; 3 red, 17 blue, 1 green; 1 red, 11 blue; 9 blue, 6 green, 3 red
|
||||
Game 43: 16 blue, 13 green, 1 red; 17 blue, 7 red, 10 green; 13 green, 5 red, 7 blue
|
||||
Game 44: 2 blue, 4 red; 15 green, 7 red; 2 green, 1 blue; 6 red, 13 green
|
||||
Game 45: 5 green, 1 blue, 8 red; 4 red, 1 blue, 5 green; 1 green, 3 red; 1 green, 2 blue, 6 red; 4 red, 3 green, 2 blue; 2 red, 2 blue, 5 green
|
||||
Game 46: 1 green, 1 red, 6 blue; 11 blue; 1 red, 1 green, 7 blue; 8 blue; 1 green, 7 blue, 2 red
|
||||
Game 47: 7 green, 9 blue, 7 red; 11 red, 13 blue, 5 green; 12 green, 12 blue, 5 red; 4 blue, 8 green, 7 red
|
||||
Game 48: 11 green, 7 red, 2 blue; 2 blue, 10 green, 3 red; 1 blue, 2 red, 1 green; 4 green, 2 red, 7 blue; 7 red, 4 green, 2 blue
|
||||
Game 49: 1 red, 2 blue, 5 green; 2 green, 4 blue; 5 blue, 2 green, 1 red; 9 blue, 1 green; 7 blue
|
||||
Game 50: 8 green, 9 blue, 2 red; 2 green, 5 blue; 14 green, 1 red, 8 blue
|
||||
Game 51: 1 green, 2 blue; 12 blue, 1 red; 2 blue
|
||||
Game 52: 3 red, 2 blue, 2 green; 4 red, 4 green, 7 blue; 2 blue, 4 red, 1 green; 3 green; 1 red, 9 green, 7 blue
|
||||
Game 53: 9 blue, 12 red, 7 green; 8 blue, 6 green; 1 green, 8 blue, 9 red; 12 red, 6 green; 9 blue, 14 red, 10 green; 7 red, 3 green, 5 blue
|
||||
Game 54: 8 green, 5 blue, 5 red; 4 green, 13 blue, 2 red; 2 blue, 5 red, 1 green; 3 red, 3 green, 10 blue
|
||||
Game 55: 17 red, 15 green, 17 blue; 6 red, 5 green, 7 blue; 17 green, 6 blue, 5 red
|
||||
Game 56: 7 blue, 6 red, 7 green; 10 green, 3 red; 9 red, 3 blue, 5 green
|
||||
Game 57: 5 blue, 11 red, 1 green; 13 red, 1 green, 2 blue; 2 blue, 4 red; 1 green, 10 red, 1 blue; 1 green, 8 red
|
||||
Game 58: 1 red, 2 green, 9 blue; 1 green, 1 blue, 1 red; 2 red, 6 blue, 2 green; 14 blue, 1 green, 1 red; 5 blue, 1 red, 2 green; 14 blue, 2 green
|
||||
Game 59: 9 green, 2 blue, 5 red; 9 red, 5 green; 10 red, 1 blue, 8 green
|
||||
Game 60: 8 blue, 6 red, 4 green; 3 red, 12 green, 9 blue; 4 blue, 5 red, 5 green; 4 red, 8 blue; 7 green, 12 blue, 6 red
|
||||
Game 61: 5 blue, 13 red, 1 green; 5 red, 5 blue; 1 red, 3 blue; 1 green, 9 red; 10 red, 3 blue, 1 green
|
||||
Game 62: 1 blue, 13 red; 4 blue, 5 red; 11 blue, 8 red, 1 green
|
||||
Game 63: 14 blue, 5 red; 9 blue, 14 green, 5 red; 3 red, 8 green, 15 blue; 4 blue, 15 green, 6 red
|
||||
Game 64: 13 red, 6 blue, 11 green; 12 red, 1 blue, 8 green; 1 red, 17 green; 13 red, 12 green, 7 blue
|
||||
Game 65: 4 red, 17 blue, 3 green; 2 green, 12 blue, 9 red; 2 green, 17 blue, 5 red; 1 red, 1 green, 4 blue; 9 red, 16 blue; 7 blue, 9 red
|
||||
Game 66: 10 blue, 10 green, 5 red; 10 green, 3 blue, 5 red; 1 red, 1 green, 10 blue; 2 green, 5 red, 20 blue; 8 blue, 11 green, 13 red; 2 green, 18 blue, 2 red
|
||||
Game 67: 6 red, 1 green; 5 red, 10 blue; 6 blue, 6 red
|
||||
Game 68: 4 green, 1 red, 5 blue; 5 red, 5 blue; 7 red, 6 green; 8 red, 1 blue
|
||||
Game 69: 2 blue, 11 red; 4 red, 6 green, 1 blue; 4 red, 1 blue, 14 green
|
||||
Game 70: 15 red, 8 blue, 5 green; 5 green, 2 red, 8 blue; 8 red, 3 green, 10 blue
|
||||
Game 71: 4 blue, 2 red; 12 green, 4 blue; 10 green
|
||||
Game 72: 3 blue, 4 green, 6 red; 6 red, 5 green, 8 blue; 10 red, 6 green, 5 blue; 1 green, 2 blue; 10 red, 5 blue, 4 green
|
||||
Game 73: 5 blue, 1 red; 1 green, 11 blue; 10 blue; 12 blue, 1 red; 1 red, 9 blue; 7 blue, 1 green, 1 red
|
||||
Game 74: 7 green, 6 blue, 7 red; 7 blue, 6 green, 15 red; 7 red, 5 blue, 1 green; 1 blue, 6 red, 8 green; 8 green, 14 red, 3 blue
|
||||
Game 75: 8 green, 3 red, 3 blue; 1 blue, 6 red, 7 green; 9 green, 3 blue; 3 blue, 9 green, 6 red; 4 blue, 1 red, 3 green; 4 green, 1 blue, 16 red
|
||||
Game 76: 4 blue, 3 green; 2 blue, 1 red, 6 green; 12 blue; 1 green, 14 blue
|
||||
Game 77: 5 green, 10 red, 11 blue; 3 red; 8 green, 6 red, 9 blue
|
||||
Game 78: 7 red, 7 green; 8 blue; 6 green, 7 red, 5 blue
|
||||
Game 79: 11 blue, 2 red, 4 green; 2 green, 3 red, 15 blue; 1 green, 15 blue, 1 red
|
||||
Game 80: 3 red, 17 green, 8 blue; 8 green, 10 blue; 4 green, 1 red, 14 blue
|
||||
Game 81: 17 green, 10 red, 10 blue; 9 green, 9 blue, 7 red; 11 red, 11 green, 4 blue; 15 blue, 5 red; 11 blue, 8 green, 15 red; 3 green, 16 red
|
||||
Game 82: 8 green, 9 blue, 1 red; 1 red, 8 green, 9 blue; 2 green, 12 blue
|
||||
Game 83: 2 green, 11 red, 20 blue; 20 blue, 1 green, 4 red; 2 green, 6 red, 20 blue; 17 blue, 10 red
|
||||
Game 84: 1 green, 9 red; 4 blue, 4 green; 1 green, 6 red, 14 blue
|
||||
Game 85: 5 red, 10 green, 9 blue; 8 blue, 3 green, 2 red; 4 blue, 14 green, 3 red; 5 red, 4 blue
|
||||
Game 86: 8 blue, 9 green, 5 red; 5 red, 10 green, 1 blue; 15 blue, 1 red, 2 green; 8 red, 8 blue, 10 green
|
||||
Game 87: 13 green, 2 red, 4 blue; 3 red, 11 green, 9 blue; 6 blue, 3 red, 12 green
|
||||
Game 88: 2 red, 7 blue, 3 green; 2 blue, 9 red; 9 red, 6 blue, 7 green; 6 green, 13 blue, 9 red; 6 green, 2 red, 15 blue; 1 red, 8 green, 7 blue
|
||||
Game 89: 11 red, 1 blue, 2 green; 6 blue, 5 green, 4 red; 15 red, 4 green, 5 blue; 11 red, 3 blue, 10 green; 6 blue, 13 green, 12 red
|
||||
Game 90: 2 red, 2 blue, 4 green; 2 red, 2 blue; 9 green, 1 red, 1 blue; 5 green, 1 red; 7 green, 2 red; 2 green, 1 blue
|
||||
Game 91: 5 blue, 3 red, 1 green; 1 red, 4 blue, 6 green; 6 blue, 6 green, 5 red
|
||||
Game 92: 16 green, 1 blue, 12 red; 18 green, 14 red, 1 blue; 16 red, 1 green; 4 blue, 16 red, 18 green
|
||||
Game 93: 9 red, 8 blue, 14 green; 1 blue, 1 green, 6 red; 4 blue, 4 red, 14 green
|
||||
Game 94: 11 green, 4 blue, 2 red; 1 red, 1 green, 1 blue; 4 red, 1 blue, 2 green
|
||||
Game 95: 5 blue, 2 red, 9 green; 5 blue, 8 green; 1 green, 15 blue; 5 red, 9 green, 5 blue; 3 green, 17 blue, 5 red
|
||||
Game 96: 2 green, 14 blue, 1 red; 3 green, 3 red, 14 blue; 2 red, 2 green, 13 blue
|
||||
Game 97: 2 green, 2 red; 2 blue, 1 green; 7 blue, 3 red
|
||||
Game 98: 2 red, 1 blue, 12 green; 2 blue, 10 green, 5 red; 11 green, 9 blue; 6 blue, 17 green; 7 blue, 9 green, 9 red; 1 red, 11 green, 9 blue
|
||||
Game 99: 2 green, 9 red, 1 blue; 3 green, 1 blue, 14 red; 5 green, 6 blue; 1 blue, 2 green, 3 red; 4 blue, 10 red, 1 green
|
||||
Game 100: 4 green, 4 blue, 15 red; 3 green, 1 red, 13 blue; 5 green, 5 blue, 10 red
|
||||
@@ -0,0 +1,30 @@
|
||||
--- Day 3: Gear Ratios ---
|
||||
|
||||
You and the Elf eventually reach a gondola lift station; he says the gondola lift will take you up to the water source, but this is as far as he can bring you. You go inside.
|
||||
|
||||
It doesn't take long to find the gondolas, but there seems to be a problem: they're not moving.
|
||||
|
||||
"Aaah!"
|
||||
|
||||
You turn around to see a slightly-greasy Elf with a wrench and a look of surprise. "Sorry, I wasn't expecting anyone! The gondola lift isn't working right now; it'll still be a while before I can fix it." You offer to help.
|
||||
|
||||
The engineer explains that an engine part seems to be missing from the engine, but nobody can figure out which one. If you can add up all the part numbers in the engine schematic, it should be easy to work out which part is missing.
|
||||
|
||||
The engine schematic (your puzzle input) consists of a visual representation of the engine. There are lots of numbers and symbols you don't really understand, but apparently any number adjacent to a symbol, even diagonally, is a "part number" and should be included in your sum. (Periods (.) do not count as a symbol.)
|
||||
|
||||
Here is an example engine schematic:
|
||||
|
||||
467..114..
|
||||
...*......
|
||||
..35..633.
|
||||
......#...
|
||||
617*......
|
||||
.....+.58.
|
||||
..592.....
|
||||
......755.
|
||||
...$.*....
|
||||
.664.598..
|
||||
|
||||
In this schematic, two numbers are not part numbers because they are not adjacent to a symbol: 114 (top right) and 58 (middle right). Every other number is adjacent to a symbol and so is a part number; their sum is 4361.
|
||||
|
||||
Of course, the actual engine schematic is much larger. What is the sum of all of the part numbers in the engine schematic?
|
||||
@@ -0,0 +1,140 @@
|
||||
..224.....487...................718.....................378............................................284........310......313..........311.
|
||||
....*..............................*744....486*485......*......741......@...359.#666...439................*925....*......$..+........@......
|
||||
.235................758..440...........................251....*......262.....*..........*......................752......774.......515.......
|
||||
.........705%..@746........+..942*591.347.470...#..257.........637...........793.......299..../.....813....509......464......&.........688..
|
||||
.....82................................*.../..901.....*..................836.....&............814...*........*..............80...17*....*...
|
||||
.../...*...679.661.....299...........222.............875.....213...161............964...894.........998.....310....258.85...........735.586.
|
||||
.650..23..#......*.......................................760*........@./........................202...................*.....339.............
|
||||
..............598......#.....536....702*.........705..........793......957............./........*...935...........965.......................
|
||||
..................*.357...+.....@.......242.......*......283..*...=956.......118.......959...184...*..............*....401*527.....348...161
|
||||
.63=...955.523..77......978.846....849..........699..........790........=911.*.....87...............486.........914..............=..........
|
||||
.........*.........842......*.......*..................*127....................844...*....946.......................235...209@...710.735....
|
||||
...........@.........*.....144....226....298........560.....253.........431......*...586.......723..../...482.......&...................*...
|
||||
...........871../918........................+....................329*......%.....906.............*...350.....@...............365.......361..
|
||||
......................536............................+..793..........664.....739................507......289.....256%...73..*...............
|
||||
.356..834..............*.........96.939..............28.+....=..............*...........................*................$.553..........526.
|
||||
...*...*.............501..746....*..-.......=.................890.....+...701..............807........447......97$..%...........58......$...
|
||||
.891....346...699...........*.421......+....666......198*791......340.433............#...%...*.......................316........*.....%.....
|
||||
..............%........81.984...........462....................../..........116...711....963...$................380.......745...85....224...
|
||||
.........370......923..@.....................563...........188+.........326*...................67.815..............*582.....................
|
||||
.........*........-........#530.........489........59...................................................#.....57.........100.*.......441*161
|
||||
.637*....961...........118...........21*...........@..216+.........................+....432*.*309..64....992.......81......=.781.644........
|
||||
.....324.........126......*166...............&...................385*..............233............*................*..436...........*517....
|
||||
.88*.........390*................355..335...372....+254..............294...$589........&..803/.....38..-...........56..$....................
|
||||
....235.-.........+196...948....*........-................359.........................398.............608..../.................145..346.....
|
||||
........915.................-.485.945.................936*................114.............118...............490.536..............*.%........
|
||||
.663........61.......856..........+....343....859...............*345.......*...=862............711.............................313.....606..
|
||||
........23...$.....@..................*......................316.....529.362.............49......................307*791....................
|
||||
225...............281...#..222.....@..283..............675............*.........911*90..-.....914..%39....509...............................
|
||||
.......797*....$........23..../...895.............67.......164.896.....554.....................*............=..............460........181...
|
||||
...........211.474...............................@...........*....*201..........911.717.#....192.75..679...........$.........*.........=....
|
||||
....355.........................&.....................678.650......................*.....128.....*.....*.........925..230...105.............
|
||||
....*.......409#.......*897.....698....427.........+....*.......*...............................313...670..521.......*....&.............*308
|
||||
...838..335.................367........-..........325....233...224...950......688.....199.774.........................793.108........501....
|
||||
...........*..102..924.349...+..595....................................*................&..............395+.....................753.........
|
||||
.........318...*......*........*....676...759.154...................524...........908.........694.211................173...........*214..424
|
||||
....458........403...........958.98....*........*..............688......957...488..+...........*.../....................................*...
|
||||
.......*.............591...............218.....203.....196$.......+....*........*......................765......971......./....927*741..227.
|
||||
......592..%60.$.....*.....885/....287...............................474.........409......226.174.......@........*.....230..................
|
||||
...............162.169.................510..962..............17......................32@..*...*.................225....................-....
|
||||
.....880...................201.....823*........*...914.724.........89...&.......267=.....717.54.436..........60...............&.........69..
|
||||
710........601....306.287.....+.........65...308....&...=.../......*.....926..................................*........278.415......-.......
|
||||
..............*..*......&..........241.%...................827../.265.............662.678......@...#......@.....$......-............734.144.
|
||||
.............424..434.....701.....*........380*731.............24.................*...&........973..741....728..357.........................
|
||||
........304.................*...881................238.....740.........947........587...22...........................271*........603....@...
|
||||
...................266.....918....................*..........+.519.617..*...826..........*............./268..974.........486.376....*.295...
|
||||
...939.........363.*...............378..........302....586........*....740...=..........380........931...........................12.........
|
||||
...*..........-.....387...............*..588..............*..../...............315...................-...712..491.........956.....#.........
|
||||
.180.454...................104..661...91...*.............811....370......471...-....419....804..........*...................*...............
|
||||
.....*.......@../464........%..*............243.....578...................&..........*...........604..250.....784....750....998.............
|
||||
.....245....165.................771...................&.......#.691...768....654....261.........................*.......*............566....
|
||||
441..................91.....194.......643...932*............379.#....$.......*.................86.............940..263.638...........*......
|
||||
...+.............%.../.......#.........*........344...795..................991..........544....*..................*..........767...266......
|
||||
.......-..708..727.....191$......*.....698....=...................990................+.....*....308.......@......325.........*.........44...
|
||||
...18.397....=.....93.........649.900.........62....-........322.....*.......@......339....619..........404..........540........./....*.....
|
||||
..../...............%............................742............*...........196................874.205........96#..............203.224......
|
||||
.........704...727.................496.......*........135....769........./.................%....&....*.../..=.........757...................
|
||||
........*........*..424..........&........714.5........*...........@....884...............114.......674.144..83..........*302...........%...
|
||||
........29....179..*............104..................531....629.455..................473......300....................254..............640...
|
||||
..................296.......................................................1........*.......%..............548........*.....103............
|
||||
....381...........................365#..713.282.......%744....................../....709...#...=...431...$.*......*.....837.....*9.....*....
|
||||
......*.90.....347.179#...................%.......359..........92............304...*.....923.446.......385.699.....749..............193.206.
|
||||
....922.+.......*.......-197.....................*.......128........273....@.....758..............439...................650*54.736#.........
|
||||
................817..-..........152..594..949..807.......$...224...*.....124............889.......=...................................625...
|
||||
....139....667......239........*...........*.......387........%..806........../...........*..788....632...........=8......584-......*.%.....
|
||||
...........*.................280...........11.........*726............181......761..-....66.....%....-................64...........14.......
|
||||
............742.736.725..........708.667..........332.......828*750......-.........425.......................944.....*...................926
|
||||
.719...110...........*.....348...=..........121......*........................................*.......961.....*.......971...........+.......
|
||||
..../.....*629........830..*............91....&..241..491...930............561................889....*....710.333..............163...311....
|
||||
......%...................252.../..................*...........*270.......................165.....208.......*..................../.......694
|
||||
...914...126...267.183........952..$645......414.822................................69.......-..........=..112.464..267....359..........*...
|
||||
.............7*..........................806.../.....931.....*.....355..............*....928...........854.........-..............*993...101
|
||||
439.897...........%...........8......381...*........*....748..987....*............437.......*....954.......................*................
|
||||
.......*595....783........49.....110.$...675...8...60.....=........981........&..........730....*.............336.......120.790..........386
|
||||
............90..............*212...*..........*.......985.....153........*..12...912*383......665.....754.....-.....................950.....
|
||||
......790#.*........896@.........773....777..581..514*....910.....5.....579.............................=.......#.....................*.....
|
||||
...&.......496...........347..............*...............*...................../............................790..............334......912..
|
||||
692............609....&.......694..........693...213....620......695......871..385.......82..........785.......................*..163.......
|
||||
.........#....*......984.........*.................=............*.......................................*.545...-............978.....*......
|
||||
......971...477.............465......196*313..........447.......766......49.......126*480.............798......792..359*193...........837...
|
||||
................157...........+..................773.=..............752$....................447*565..........................*53............
|
||||
.384%..........@.........449............470..749...@.........@792..............138..527.......................339.....299.505...........287.
|
||||
......691........700........@......96..........*........721*.....................@....*...942......845........*......-.........713..........
|
||||
.....*......260/...*...........................491..452.....336.......................73....+..960..........238...........163$..&...=.@.....
|
||||
....689.............831...282....709.960.............=.............204............................#..............59...97..........199..111..
|
||||
........................$........../........-....498......................557....&...........972............450.............................
|
||||
.............653........476...398.........619...*.....*280..923..............*31..691.........*........=...*.....67......782................
|
||||
..............*....%..........*.........+......268...........&........428....................408....740....576....*.......*.........$.......
|
||||
....-../...734......317.114.332...795...743.........................-..=..908...........381.......................914...420.*647....528.....
|
||||
..284.825...............*......................721/.=929.........324.....*....167.561...*.....815*466.......................................
|
||||
..............389..304.480.......851..@....585..............942%......#.496....*....-.53................170....938*..........518............
|
||||
........368..*.....@..............*....941..+.......*...............930.........364.......522......................59.........+....$....652.
|
||||
...........+.963...................949...........828.784......860............*......420.....*..................*......548...........310.*...
|
||||
.....476...............*...............=...94.+..................&........589.833....*..426.940.....&.....959.993.&88....................398
|
||||
.......*................624....917...838..*...664.......721........................833...$.......672......$............19...................
|
||||
....350.......................&....=..............333.................707....................................240..336....=...746.263..$463..
|
||||
.........................-.........220.....663...../.............*849..#..631.....712....=.../...308.580.............*..........*...........
|
||||
.78@......../..........422....444.............*...............281............*...*....447..37.......*................814....................
|
||||
........./...788...810.........&..............369..985....-................92................................684...............74...........
|
||||
......279.........*......128/....464........#...../......944........978...............163..984*5.@............+.......165......*....285.....
|
||||
..................889.............*.......969........................%.......5......&....$........272....................*......374.........
|
||||
.........&..............@948..*..13.358........796.............632............*....789........91*..............*66........152...............
|
||||
........508...+..............3...........544.....$.517.....703....*774.......434............/....794........932.............................
|
||||
...$...........241.....74...........974..*...954............*.......................375..772...........218.........414...........*366....252
|
||||
.501..566...............*..........*....599.....#........256.....468@..942.101.........*..........156...*.............*.......998...........
|
||||
...../.............263.312....+..767..............#.........................*...&95..838.162=.....+....130.........583..544.......176.......
|
||||
............................936......826.......421.......-139.......982...893.......................*..................*........./..........
|
||||
.284.....=724...................661.$....694........85..........438.............51...............616.698.*36.....262......357+........224...
|
||||
....@..........491........+........................@......193......*596...........%../844...387.................$.....132.........%.........
|
||||
.......84..............362.................................*..98..........&................*....14....394..........$..............56........
|
||||
.........*432.....512................704......424.............*............74........196%..875...*.....*............132.......229...........
|
||||
..............723*.........568........*..108........672......55.172...217.........................289.427........................*..........
|
||||
.........#795.........214....*.336...94....*....988................%..&.............*86......*...............838&.......540.......902.......
|
||||
.922...........288........719.....*........845...&..558......#...................524......195.704.....................................77....
|
||||
...*....842....../...166........883...-................*503..451..305../....600............................900..280.....*169...586..........
|
||||
751....*.........../.*......944......116....416.........................877....*....418...194........644..*....=.....244..........#.....354.
|
||||
.......118......208...................................788...................826........$....$...207.....@..152...........893*608.......&....
|
||||
..948.......................203../....206.............*....341./977.916.........49...#........@....-............+385........................
|
||||
...*......266.................*...607...@.990......964..............-..........*.....340...697........62..............526.....-.............
|
||||
..675.....*..........612....604.............*..............492.884...........212...............*157....*...679.........*....706...716%.518..
|
||||
......103.749..989...*...................739..............$......=..=..................212..684.....35.......*.........785..............+...
|
||||
..343*......../.......680.....................*423.................476....&....420..............241..*......532.....+.......864$.....&......
|
||||
..................826........403..311...60.451.............+...........562....../.......306.......*..............420..................321...
|
||||
...241..............*...........+..=....@......*240.......845....@.........740.................968..389.177*...................640..........
|
||||
......*82...........963...211%...............38...............901.....404.........&..253..............-.....37.........218.501...*....320...
|
||||
....*...........................#215...264......298........................*970..801....*....569...............3.......*......%..859.*......
|
||||
.136.818...212...........91*72........*.........-...750.....775*728.29.270...............984.&...371..........*.........639..........670....
|
||||
...........*.../959................438.....524......*...943.........*................755...................162.................446#.........
|
||||
..........290.............751................*.....557..*...483.............421.........*............189.%................/.................
|
||||
....................9.786..-......835.......978........445.%..........350........860..662.......#...*....354........*.....682...............
|
||||
.117..57+....441...*....+............................................../............*.........88....142..........%.927......................
|
||||
...*...........*..402....................874.....734.926$../...............*633......219.84/............662...205...................334.....
|
||||
...981........367........338...332/.........=......*......119....375#.334.......146..............%.....$................384.............-511
|
||||
........165................=....................666.....................#..614.....-..%744..617.887.......848*..............................
|
||||
...........*.203.593...158....*..........152..............+817.....866.......&...............*......../.......904........701.165.80.........
|
||||
404..977.93..*....*....*...396.281......*....953....*................*.........116..97.70=..179....107..338................$...*....622.....
|
||||
......=.....445........................382.....*...672................859......*...%....................&..........-.571......717....*......
|
||||
..................240............175..........808..............225..........988............/604..............232.448..*..651......769.......
|
||||
.........569*....*........975*.....*....968..............585.....*................26.................................394....@.142...........
|
||||
......*......498..969.........360.666...%.........................919.......360........-.*.........%...................................484..
|
||||
...407................886...................................84......................933...101....58........839..425.........................
|
||||
@@ -0,0 +1,25 @@
|
||||
package day1
|
||||
|
||||
import java.io.File
|
||||
import kotlin.test.Test
|
||||
|
||||
class Day1Test {
|
||||
|
||||
@Test
|
||||
fun calculateOne() {
|
||||
val result = File("src/test/resources/day1/calibration1.txt")
|
||||
.readLines()
|
||||
.let(Day1::calculateOne)
|
||||
|
||||
assert(result == 142)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun calculateTwo() {
|
||||
val result = File("src/test/resources/day1/calibration2.txt")
|
||||
.readLines()
|
||||
.let(Day1::calculateTwo)
|
||||
|
||||
assert(result == 281)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package day2
|
||||
|
||||
import org.junit.jupiter.api.Test
|
||||
|
||||
class Day2Test {
|
||||
|
||||
@Test
|
||||
fun sumOfCompatibleGames() {
|
||||
assert(Day2.sumOfCompatibleGames("src/test/resources/day2/input.txt", Hand(12, 13, 14)) == 8)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun powerOfMinimumSetOfCubes() {
|
||||
assert(Day2.powerOfMinimumSetOfCubes("src/test/resources/day2/input.txt") == 2286)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package day3
|
||||
|
||||
import org.junit.jupiter.api.Assertions.assertEquals
|
||||
import org.junit.jupiter.api.Test
|
||||
import kotlin.test.assertContentEquals
|
||||
|
||||
class Day3Test {
|
||||
|
||||
@Test
|
||||
fun readParts() {
|
||||
assertEquals(4361, Day3.sumOfSelectedParts("src/test/resources/day3/input.txt"))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testReadParts() {
|
||||
assertContentEquals(
|
||||
listOf(467, 114, 35, 633, 617, 58, 592, 755, 664, 598),
|
||||
Day3.readParts(Day3.readLines("src/test/resources/day3/input.txt")).map(Part::number)
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testOnly114And58DropOut() {
|
||||
assertContentEquals(
|
||||
listOf(467, 35, 633, 617, 592, 755, 664, 598),
|
||||
Day3.readLines("src/test/resources/day3/input.txt").let { lines ->
|
||||
Day3.readParts(lines).filter { part -> part.isSelected(lines) }.map(Part::number)
|
||||
}
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
1abc2
|
||||
pqr3stu8vwx
|
||||
a1b2c3d4e5f
|
||||
treb7uchet
|
||||
@@ -0,0 +1,7 @@
|
||||
two1nine
|
||||
eightwothree
|
||||
abcone2threexyz
|
||||
xtwone3four
|
||||
4nineeightseven2
|
||||
zoneight234
|
||||
7pqrstsixteen
|
||||
@@ -0,0 +1,5 @@
|
||||
Game 1: 3 blue, 4 red; 1 red, 2 green, 6 blue; 2 green
|
||||
Game 2: 1 blue, 2 green; 3 green, 4 blue, 1 red; 1 green, 1 blue
|
||||
Game 3: 8 green, 6 blue, 20 red; 5 blue, 4 red, 13 green; 5 green, 1 red
|
||||
Game 4: 1 green, 3 red, 6 blue; 3 green, 6 red; 3 green, 15 blue, 14 red
|
||||
Game 5: 6 red, 1 blue, 3 green; 2 blue, 1 red, 2 green
|
||||
@@ -0,0 +1,10 @@
|
||||
467..114..
|
||||
...*......
|
||||
..35..633.
|
||||
......#...
|
||||
617*......
|
||||
.....+.58.
|
||||
..592.....
|
||||
......755.
|
||||
...$.*....
|
||||
.664.598..
|
||||
Reference in new issue
Block a user