Compare commits
28 Commits
8960dcb072
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 34be9e0847 | |||
| 6ea67eac0c | |||
| bb366fbe17 | |||
| 681b7bae16 | |||
| c8ded5c42d | |||
| b37f1ec366 | |||
| 40e2e329e0 | |||
| fa5bf2e85b | |||
| ea1b57b17e | |||
| 174671e6f5 | |||
| 40bcf3052f | |||
| 1e634b7ee9 | |||
| 6e625dcf06 | |||
| 141216920d | |||
| b685e81c58 | |||
| 1adc10ea88 | |||
| db7c31cb39 | |||
| 1ad1da1309 | |||
| 228392fe83 | |||
| 4837cbf290 | |||
| 8503cee52b | |||
| b16b052115 | |||
| bc76283458 | |||
| 9d2a087801 | |||
| 0bd3b6dc69 | |||
| da81f67b7f | |||
| caa7da5a7d | |||
| eebe707ef9 |
108
internal/2015/DayFourteen/code.go
Normal file
108
internal/2015/DayFourteen/code.go
Normal file
@@ -0,0 +1,108 @@
|
|||||||
|
package dayfourteen
|
||||||
|
|
||||||
|
import (
|
||||||
|
"advent-of-code/internal/registry"
|
||||||
|
"os"
|
||||||
|
"regexp"
|
||||||
|
"strconv"
|
||||||
|
"strings"
|
||||||
|
)
|
||||||
|
|
||||||
|
var reindeerPattern = regexp.MustCompile(`\w+ can fly (\d+) km/s for (\d+) seconds, but then must rest for (\d+) seconds\.`)
|
||||||
|
|
||||||
|
const raceTime = 2503
|
||||||
|
|
||||||
|
type Reindeer struct {
|
||||||
|
Speed int
|
||||||
|
FlyTime int
|
||||||
|
RestTime int
|
||||||
|
Points int
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
registry.Register("2015D14", ParseInput, PartOne, PartTwo)
|
||||||
|
}
|
||||||
|
|
||||||
|
func ParseInput(filepath string) []string {
|
||||||
|
content, _ := os.ReadFile(filepath)
|
||||||
|
return strings.Split(string(content), "\n")
|
||||||
|
}
|
||||||
|
|
||||||
|
func parseReindeer(line string) Reindeer {
|
||||||
|
matches := reindeerPattern.FindStringSubmatch(line)
|
||||||
|
speed, _ := strconv.Atoi(matches[1])
|
||||||
|
flyTime, _ := strconv.Atoi(matches[2])
|
||||||
|
restTime, _ := strconv.Atoi(matches[3])
|
||||||
|
return Reindeer{Speed: speed, FlyTime: flyTime, RestTime: restTime}
|
||||||
|
}
|
||||||
|
|
||||||
|
func parseReindeers(data []string) []Reindeer {
|
||||||
|
reindeers := make([]Reindeer, 0, len(data))
|
||||||
|
for _, line := range data {
|
||||||
|
reindeers = append(reindeers, parseReindeer(line))
|
||||||
|
}
|
||||||
|
return reindeers
|
||||||
|
}
|
||||||
|
|
||||||
|
func (reindeer Reindeer) distanceAtTime(time int) int {
|
||||||
|
cycleTime := reindeer.FlyTime + reindeer.RestTime
|
||||||
|
fullCycles := time / cycleTime
|
||||||
|
distance := fullCycles * reindeer.Speed * reindeer.FlyTime
|
||||||
|
remainingTime := time % cycleTime
|
||||||
|
distance += reindeer.Speed * min(remainingTime, reindeer.FlyTime)
|
||||||
|
return distance
|
||||||
|
}
|
||||||
|
|
||||||
|
func calculateMaxDistance(data []string, time int) int {
|
||||||
|
reindeers := parseReindeers(data)
|
||||||
|
maxDistance := 0
|
||||||
|
|
||||||
|
for _, reindeer := range reindeers {
|
||||||
|
distance := reindeer.distanceAtTime(time)
|
||||||
|
if distance > maxDistance {
|
||||||
|
maxDistance = distance
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return maxDistance
|
||||||
|
}
|
||||||
|
|
||||||
|
func calculateMaxPoints(data []string, time int) int {
|
||||||
|
reindeers := parseReindeers(data)
|
||||||
|
|
||||||
|
for second := 1; second <= time; second++ {
|
||||||
|
maxDistance := 0
|
||||||
|
distances := make([]int, len(reindeers))
|
||||||
|
|
||||||
|
for idx := range reindeers {
|
||||||
|
distance := reindeers[idx].distanceAtTime(second)
|
||||||
|
distances[idx] = distance
|
||||||
|
if distance > maxDistance {
|
||||||
|
maxDistance = distance
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for idx := range reindeers {
|
||||||
|
if distances[idx] == maxDistance {
|
||||||
|
reindeers[idx].Points++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
maxPoints := 0
|
||||||
|
for idx := range reindeers {
|
||||||
|
if reindeers[idx].Points > maxPoints {
|
||||||
|
maxPoints = reindeers[idx].Points
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return maxPoints
|
||||||
|
}
|
||||||
|
|
||||||
|
func PartOne(data []string) int {
|
||||||
|
return calculateMaxDistance(data, raceTime)
|
||||||
|
}
|
||||||
|
|
||||||
|
func PartTwo(data []string) int {
|
||||||
|
return calculateMaxPoints(data, raceTime)
|
||||||
|
}
|
||||||
24
internal/2015/DayFourteen/code_test.go
Normal file
24
internal/2015/DayFourteen/code_test.go
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
package dayfourteen
|
||||||
|
|
||||||
|
import "testing"
|
||||||
|
|
||||||
|
var testInput = []string{
|
||||||
|
"Comet can fly 14 km/s for 10 seconds, but then must rest for 127 seconds.",
|
||||||
|
"Dancer can fly 16 km/s for 11 seconds, but then must rest for 162 seconds.",
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestPartOne(t *testing.T) {
|
||||||
|
expected := 1120
|
||||||
|
got := calculateMaxDistance(testInput, 1000)
|
||||||
|
if got != expected {
|
||||||
|
t.Errorf("calculateMaxDistance(testInput, 1000) = %d, want %d", got, expected)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestPartTwo(t *testing.T) {
|
||||||
|
expected := 689
|
||||||
|
got := calculateMaxPoints(testInput, 1000)
|
||||||
|
if got != expected {
|
||||||
|
t.Errorf("calculateMaxPoints(testInput, 1000) = %d, want %d", got, expected)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -5,6 +5,7 @@ import (
|
|||||||
_ "advent-of-code/internal/2015/DayEleven"
|
_ "advent-of-code/internal/2015/DayEleven"
|
||||||
_ "advent-of-code/internal/2015/DayFive"
|
_ "advent-of-code/internal/2015/DayFive"
|
||||||
_ "advent-of-code/internal/2015/DayFour"
|
_ "advent-of-code/internal/2015/DayFour"
|
||||||
|
_ "advent-of-code/internal/2015/DayFourteen"
|
||||||
_ "advent-of-code/internal/2015/DayNine"
|
_ "advent-of-code/internal/2015/DayNine"
|
||||||
_ "advent-of-code/internal/2015/DayOne"
|
_ "advent-of-code/internal/2015/DayOne"
|
||||||
_ "advent-of-code/internal/2015/DaySeven"
|
_ "advent-of-code/internal/2015/DaySeven"
|
||||||
|
|||||||
73
internal/2016/DayFive/code.go
Normal file
73
internal/2016/DayFive/code.go
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
package dayfive
|
||||||
|
|
||||||
|
import (
|
||||||
|
"advent-of-code/internal/registry"
|
||||||
|
"crypto/md5"
|
||||||
|
"fmt"
|
||||||
|
"os"
|
||||||
|
"strconv"
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
registry.Register("2016D5", ParseInput, PartOne, PartTwo)
|
||||||
|
}
|
||||||
|
|
||||||
|
func ParseInput(filepath string) string {
|
||||||
|
content, _ := os.ReadFile(filepath)
|
||||||
|
return string(content)
|
||||||
|
}
|
||||||
|
|
||||||
|
func PartOne(data string) int {
|
||||||
|
doorIDBytes := []byte(data)
|
||||||
|
doorIDLen := len(doorIDBytes)
|
||||||
|
input := make([]byte, doorIDLen, doorIDLen+20)
|
||||||
|
copy(input, doorIDBytes)
|
||||||
|
password := make([]byte, 0, 8)
|
||||||
|
index := 0
|
||||||
|
hexChars := "0123456789abcdef"
|
||||||
|
|
||||||
|
for len(password) < 8 {
|
||||||
|
indexBytes := strconv.AppendInt(input[:doorIDLen], int64(index), 10)
|
||||||
|
hash := md5.Sum(indexBytes)
|
||||||
|
|
||||||
|
if hash[0] == 0 && hash[1] == 0 && hash[2] < 16 {
|
||||||
|
char := hexChars[hash[2]&0x0F]
|
||||||
|
password = append(password, char)
|
||||||
|
}
|
||||||
|
index++
|
||||||
|
}
|
||||||
|
|
||||||
|
fmt.Println(string(password))
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func PartTwo(data string) int {
|
||||||
|
doorIDBytes := []byte(data)
|
||||||
|
doorIDLen := len(doorIDBytes)
|
||||||
|
input := make([]byte, doorIDLen, doorIDLen+20)
|
||||||
|
copy(input, doorIDBytes)
|
||||||
|
password := make([]byte, 8)
|
||||||
|
filled := make([]bool, 8)
|
||||||
|
filledCount := 0
|
||||||
|
index := 0
|
||||||
|
hexChars := "0123456789abcdef"
|
||||||
|
|
||||||
|
for filledCount < 8 {
|
||||||
|
indexBytes := strconv.AppendInt(input[:doorIDLen], int64(index), 10)
|
||||||
|
hash := md5.Sum(indexBytes)
|
||||||
|
|
||||||
|
if hash[0] == 0 && hash[1] == 0 && hash[2] < 16 {
|
||||||
|
position := int(hash[2] & 0x0F)
|
||||||
|
if position < 8 && !filled[position] {
|
||||||
|
char := hexChars[hash[3]>>4]
|
||||||
|
password[position] = char
|
||||||
|
filled[position] = true
|
||||||
|
filledCount++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
index++
|
||||||
|
}
|
||||||
|
|
||||||
|
fmt.Println(string(password))
|
||||||
|
return 0
|
||||||
|
}
|
||||||
58
internal/2016/DayFive/code_test.go
Normal file
58
internal/2016/DayFive/code_test.go
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
package dayfive
|
||||||
|
|
||||||
|
import (
|
||||||
|
"bytes"
|
||||||
|
"os"
|
||||||
|
"strings"
|
||||||
|
"testing"
|
||||||
|
)
|
||||||
|
|
||||||
|
var testInput = "abc"
|
||||||
|
|
||||||
|
func TestPartOne(t *testing.T) {
|
||||||
|
expected := "18f47a30"
|
||||||
|
|
||||||
|
oldStdout := os.Stdout
|
||||||
|
r, w, err := os.Pipe()
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("Failed to create pipe: %v", err)
|
||||||
|
}
|
||||||
|
os.Stdout = w
|
||||||
|
|
||||||
|
PartOne(testInput)
|
||||||
|
|
||||||
|
_ = w.Close()
|
||||||
|
os.Stdout = oldStdout
|
||||||
|
|
||||||
|
var buffer bytes.Buffer
|
||||||
|
_, _ = buffer.ReadFrom(r)
|
||||||
|
got := strings.TrimSpace(buffer.String())
|
||||||
|
|
||||||
|
if got != expected {
|
||||||
|
t.Errorf("PartOne() printed %q, want %q", got, expected)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestPartTwo(t *testing.T) {
|
||||||
|
expected := "05ace8e3"
|
||||||
|
|
||||||
|
oldStdout := os.Stdout
|
||||||
|
r, w, err := os.Pipe()
|
||||||
|
if err != nil {
|
||||||
|
t.Fatalf("Failed to create pipe: %v", err)
|
||||||
|
}
|
||||||
|
os.Stdout = w
|
||||||
|
|
||||||
|
PartTwo(testInput)
|
||||||
|
|
||||||
|
_ = w.Close()
|
||||||
|
os.Stdout = oldStdout
|
||||||
|
|
||||||
|
var buffer bytes.Buffer
|
||||||
|
_, _ = buffer.ReadFrom(r)
|
||||||
|
got := strings.TrimSpace(buffer.String())
|
||||||
|
|
||||||
|
if got != expected {
|
||||||
|
t.Errorf("PartTwo() printed %q, want %q", got, expected)
|
||||||
|
}
|
||||||
|
}
|
||||||
119
internal/2016/DayFour/code.go
Normal file
119
internal/2016/DayFour/code.go
Normal file
@@ -0,0 +1,119 @@
|
|||||||
|
package dayfour
|
||||||
|
|
||||||
|
import (
|
||||||
|
"advent-of-code/internal/registry"
|
||||||
|
"os"
|
||||||
|
"regexp"
|
||||||
|
"sort"
|
||||||
|
"strconv"
|
||||||
|
"strings"
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
registry.Register("2016D4", ParseInput, PartOne, PartTwo)
|
||||||
|
}
|
||||||
|
|
||||||
|
func ParseInput(filepath string) []string {
|
||||||
|
content, _ := os.ReadFile(filepath)
|
||||||
|
return strings.Split(string(content), "\n")
|
||||||
|
}
|
||||||
|
|
||||||
|
func isValidRoom(encryptedName string, expectedChecksum string) bool {
|
||||||
|
letterFrequency := [26]int{}
|
||||||
|
|
||||||
|
for _, character := range encryptedName {
|
||||||
|
if character >= 'a' && character <= 'z' {
|
||||||
|
letterFrequency[character-'a']++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
type letterFrequencyPair struct {
|
||||||
|
letter rune
|
||||||
|
count int
|
||||||
|
}
|
||||||
|
|
||||||
|
letterFrequencyPairs := make([]letterFrequencyPair, 0, 26)
|
||||||
|
for index, frequency := range letterFrequency {
|
||||||
|
if frequency > 0 {
|
||||||
|
letterFrequencyPairs = append(letterFrequencyPairs, letterFrequencyPair{
|
||||||
|
letter: rune('a' + index),
|
||||||
|
count: frequency,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sort.Slice(letterFrequencyPairs, func(i, j int) bool {
|
||||||
|
if letterFrequencyPairs[i].count != letterFrequencyPairs[j].count {
|
||||||
|
return letterFrequencyPairs[i].count > letterFrequencyPairs[j].count
|
||||||
|
}
|
||||||
|
return letterFrequencyPairs[i].letter < letterFrequencyPairs[j].letter
|
||||||
|
})
|
||||||
|
|
||||||
|
if len(letterFrequencyPairs) < 5 {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
for index := range 5 {
|
||||||
|
if letterFrequencyPairs[index].letter != rune(expectedChecksum[index]) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
|
func decryptRoomName(encryptedName string, sectorID int) string {
|
||||||
|
result := strings.Builder{}
|
||||||
|
result.Grow(len(encryptedName))
|
||||||
|
shift := sectorID % 26
|
||||||
|
for _, char := range encryptedName {
|
||||||
|
if char == '-' {
|
||||||
|
result.WriteByte(' ')
|
||||||
|
} else if char >= 'a' && char <= 'z' {
|
||||||
|
shifted := ((int(char-'a') + shift) % 26) + 'a'
|
||||||
|
result.WriteByte(byte(shifted))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result.String()
|
||||||
|
}
|
||||||
|
|
||||||
|
var roomPattern = regexp.MustCompile(`^(.+)-(\d+)(?:\[([a-z]{5})\])?$`)
|
||||||
|
|
||||||
|
func PartOne(data []string) int {
|
||||||
|
sum := 0
|
||||||
|
for _, line := range data {
|
||||||
|
if line == "" {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
matches := roomPattern.FindStringSubmatch(line)
|
||||||
|
if len(matches) < 4 || matches[3] == "" {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
encryptedName := matches[1]
|
||||||
|
sectorIdentifier, _ := strconv.Atoi(matches[2])
|
||||||
|
actualChecksum := matches[3]
|
||||||
|
if isValidRoom(encryptedName, actualChecksum) {
|
||||||
|
sum += sectorIdentifier
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return sum
|
||||||
|
}
|
||||||
|
|
||||||
|
func PartTwo(data []string) int {
|
||||||
|
for _, line := range data {
|
||||||
|
matches := roomPattern.FindStringSubmatch(line)
|
||||||
|
encryptedName := matches[1]
|
||||||
|
sectorIdentifier, _ := strconv.Atoi(matches[2])
|
||||||
|
checksum := matches[3]
|
||||||
|
|
||||||
|
if !isValidRoom(encryptedName, checksum) {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
decrypted := decryptRoomName(encryptedName, sectorIdentifier)
|
||||||
|
if strings.Contains(decrypted, "northpole") {
|
||||||
|
return sectorIdentifier
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
@@ -1,18 +1,29 @@
|
|||||||
package dayfour
|
package dayfour
|
||||||
|
|
||||||
import "testing"
|
import (
|
||||||
|
"testing"
|
||||||
|
)
|
||||||
|
|
||||||
var testInput = []string{
|
var testInput = []string{
|
||||||
"aaaaa-bbb-z-y-x-123[abxyz]",
|
"aaaaa-bbb-z-y-x-123[abxyz]",
|
||||||
"a-b-c-d-e-f-g-h-987[abcde]",
|
"a-b-c-d-e-f-g-h-987[abcde]",
|
||||||
"not-a-real-room-404[oarel]",
|
"not-a-real-room-404[oarel]",
|
||||||
"totally-real-room-200[decoy]",
|
"totally-real-room-200[decoy]",
|
||||||
|
"ijmockjgz-storage-5[gjoac]",
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestPartOne(t *testing.T) {
|
func TestPartOne(t *testing.T) {
|
||||||
expected := 1514
|
expected := 1519
|
||||||
got := PartOne(testInput)
|
got := PartOne(testInput)
|
||||||
if got != expected {
|
if got != expected {
|
||||||
t.Errorf("PartOne() = %d, want %d", got, expected)
|
t.Errorf("PartOne() = %d, want %d", got, expected)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestPartTwo(t *testing.T) {
|
||||||
|
expected := 5
|
||||||
|
got := PartTwo(testInput)
|
||||||
|
if got != expected {
|
||||||
|
t.Errorf("PartTwo() = %d, want %d", got, expected)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package year2016
|
package year2016
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
_ "advent-of-code/internal/2016/DayFive"
|
||||||
_ "advent-of-code/internal/2016/DayFour"
|
_ "advent-of-code/internal/2016/DayFour"
|
||||||
_ "advent-of-code/internal/2016/DayOne"
|
_ "advent-of-code/internal/2016/DayOne"
|
||||||
_ "advent-of-code/internal/2016/DayThree"
|
_ "advent-of-code/internal/2016/DayThree"
|
||||||
|
|||||||
64
internal/2018/DayFive/code.go
Normal file
64
internal/2018/DayFive/code.go
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
package dayfive
|
||||||
|
|
||||||
|
import (
|
||||||
|
"advent-of-code/internal/registry"
|
||||||
|
"os"
|
||||||
|
"unicode"
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
registry.Register("2018D5", ParseInput, PartOne, PartTwo)
|
||||||
|
}
|
||||||
|
|
||||||
|
func ParseInput(filepath string) string {
|
||||||
|
content, _ := os.ReadFile(filepath)
|
||||||
|
return string(content)
|
||||||
|
}
|
||||||
|
|
||||||
|
func reactPolymer(data string) int {
|
||||||
|
stack := []rune{}
|
||||||
|
|
||||||
|
for _, char := range data {
|
||||||
|
if len(stack) == 0 {
|
||||||
|
stack = append(stack, char)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
top := stack[len(stack)-1]
|
||||||
|
|
||||||
|
if unicode.ToLower(top) == unicode.ToLower(char) && top != char {
|
||||||
|
stack = stack[:len(stack)-1]
|
||||||
|
} else {
|
||||||
|
stack = append(stack, char)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return len(stack)
|
||||||
|
}
|
||||||
|
|
||||||
|
func PartOne(data string) int {
|
||||||
|
return reactPolymer(data)
|
||||||
|
}
|
||||||
|
|
||||||
|
func PartTwo(data string) int {
|
||||||
|
unitTypes := make(map[rune]bool)
|
||||||
|
for _, char := range data {
|
||||||
|
unitTypes[unicode.ToLower(char)] = true
|
||||||
|
}
|
||||||
|
|
||||||
|
shortestPolymerLength := len(data)
|
||||||
|
for unitType := range unitTypes {
|
||||||
|
filtered := make([]rune, 0, len(data))
|
||||||
|
for _, char := range data {
|
||||||
|
if unicode.ToLower(char) != unitType {
|
||||||
|
filtered = append(filtered, char)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
length := reactPolymer(string(filtered))
|
||||||
|
if length < shortestPolymerLength {
|
||||||
|
shortestPolymerLength = length
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return shortestPolymerLength
|
||||||
|
}
|
||||||
21
internal/2018/DayFive/code_test.go
Normal file
21
internal/2018/DayFive/code_test.go
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
package dayfive
|
||||||
|
|
||||||
|
import "testing"
|
||||||
|
|
||||||
|
var testInput = "dabAcCaCBAcCcaDA"
|
||||||
|
|
||||||
|
func TestPartOne(t *testing.T) {
|
||||||
|
expected := 10
|
||||||
|
got := PartOne(testInput)
|
||||||
|
if got != expected {
|
||||||
|
t.Errorf("PartOne() = %d, want %d", got, expected)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestPartTwo(t *testing.T) {
|
||||||
|
expected := 4
|
||||||
|
got := PartTwo(testInput)
|
||||||
|
if got != expected {
|
||||||
|
t.Errorf("PartTwo() = %d, want %d", got, expected)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
package year2018
|
package year2018
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
_ "advent-of-code/internal/2018/DayFive"
|
||||||
_ "advent-of-code/internal/2018/DayFour"
|
_ "advent-of-code/internal/2018/DayFour"
|
||||||
_ "advent-of-code/internal/2018/DayOne"
|
_ "advent-of-code/internal/2018/DayOne"
|
||||||
_ "advent-of-code/internal/2018/DayThree"
|
_ "advent-of-code/internal/2018/DayThree"
|
||||||
|
|||||||
91
internal/2025/DayTen/code.go
Normal file
91
internal/2025/DayTen/code.go
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
package dayten
|
||||||
|
|
||||||
|
import (
|
||||||
|
"advent-of-code/internal/registry"
|
||||||
|
"os"
|
||||||
|
"regexp"
|
||||||
|
"strconv"
|
||||||
|
"strings"
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
registry.Register("2025D10", ParseInput, PartOne, PartTwo)
|
||||||
|
}
|
||||||
|
|
||||||
|
func ParseInput(filepath string) []string {
|
||||||
|
content, _ := os.ReadFile(filepath)
|
||||||
|
return strings.Split(string(content), "\n")
|
||||||
|
}
|
||||||
|
|
||||||
|
func parseMachine(line string) ([]bool, [][]int) {
|
||||||
|
bracketRegex := regexp.MustCompile(`\[([.#]+)\]`)
|
||||||
|
parenthesisRegex := regexp.MustCompile(`\(([^)]+)\)`)
|
||||||
|
|
||||||
|
bracketMatch := bracketRegex.FindStringSubmatch(line)
|
||||||
|
targetString := bracketMatch[1]
|
||||||
|
target := make([]bool, len(targetString))
|
||||||
|
for idx, char := range targetString {
|
||||||
|
target[idx] = char == '#'
|
||||||
|
}
|
||||||
|
|
||||||
|
parenthesisMatches := parenthesisRegex.FindAllStringSubmatch(line, -1)
|
||||||
|
buttons := make([][]int, 0, len(parenthesisMatches))
|
||||||
|
|
||||||
|
for _, match := range parenthesisMatches {
|
||||||
|
buttonString := match[1]
|
||||||
|
parts := strings.Split(buttonString, ",")
|
||||||
|
button := make([]int, 0, len(parts))
|
||||||
|
for _, part := range parts {
|
||||||
|
light, _ := strconv.Atoi(part)
|
||||||
|
button = append(button, light)
|
||||||
|
}
|
||||||
|
buttons = append(buttons, button)
|
||||||
|
}
|
||||||
|
|
||||||
|
return target, buttons
|
||||||
|
}
|
||||||
|
|
||||||
|
func PartOne(data []string) int {
|
||||||
|
total := 0
|
||||||
|
for _, line := range data {
|
||||||
|
target, buttons := parseMachine(line)
|
||||||
|
numberOfLights := len(target)
|
||||||
|
numberOfButtons := len(buttons)
|
||||||
|
minimumPresses := numberOfButtons + 1
|
||||||
|
|
||||||
|
for mask := 0; mask < (1 << numberOfButtons); mask++ {
|
||||||
|
lights := make([]bool, numberOfLights)
|
||||||
|
presses := 0
|
||||||
|
|
||||||
|
for buttonIdx := range numberOfButtons {
|
||||||
|
if mask&(1<<buttonIdx) != 0 {
|
||||||
|
presses++
|
||||||
|
for _, light := range buttons[buttonIdx] {
|
||||||
|
if light < numberOfLights {
|
||||||
|
lights[light] = !lights[light]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
matches := true
|
||||||
|
for idx := range numberOfLights {
|
||||||
|
if lights[idx] != target[idx] {
|
||||||
|
matches = false
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if matches && presses < minimumPresses {
|
||||||
|
minimumPresses = presses
|
||||||
|
}
|
||||||
|
}
|
||||||
|
total += minimumPresses
|
||||||
|
}
|
||||||
|
|
||||||
|
return total
|
||||||
|
}
|
||||||
|
|
||||||
|
func PartTwo(data []string) int {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
25
internal/2025/DayTen/code_test.go
Normal file
25
internal/2025/DayTen/code_test.go
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
package dayten
|
||||||
|
|
||||||
|
import "testing"
|
||||||
|
|
||||||
|
var testInput = []string{
|
||||||
|
"[.##.] (3) (1,3) (2) (2,3) (0,2) (0,1) {3,5,4,7}",
|
||||||
|
"[...#.] (0,2,3,4) (2,3) (0,4) (0,1,2) (1,2,3,4) {7,5,12,7,2}",
|
||||||
|
"[.###.#] (0,1,2,3,4) (0,3,4) (0,1,2,4,5) (1,2) {10,11,11,5,10,5}",
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestPartOne(t *testing.T) {
|
||||||
|
expected := 7
|
||||||
|
got := PartOne(testInput)
|
||||||
|
if got != expected {
|
||||||
|
t.Errorf("PartOne() = %d, want %d", got, expected)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestPartTwo(t *testing.T) {
|
||||||
|
expected := 33
|
||||||
|
got := PartTwo(testInput)
|
||||||
|
if got != expected {
|
||||||
|
t.Errorf("PartTwo() = %d, want %d", got, expected)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -8,6 +8,7 @@ import (
|
|||||||
_ "advent-of-code/internal/2025/DayOne"
|
_ "advent-of-code/internal/2025/DayOne"
|
||||||
_ "advent-of-code/internal/2025/DaySeven"
|
_ "advent-of-code/internal/2025/DaySeven"
|
||||||
_ "advent-of-code/internal/2025/DaySix"
|
_ "advent-of-code/internal/2025/DaySix"
|
||||||
|
_ "advent-of-code/internal/2025/DayTen"
|
||||||
_ "advent-of-code/internal/2025/DayThree"
|
_ "advent-of-code/internal/2025/DayThree"
|
||||||
_ "advent-of-code/internal/2025/DayTwo"
|
_ "advent-of-code/internal/2025/DayTwo"
|
||||||
)
|
)
|
||||||
|
|||||||
9
internal/data/2015/DayFourteen/input.txt
Normal file
9
internal/data/2015/DayFourteen/input.txt
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
Vixen can fly 19 km/s for 7 seconds, but then must rest for 124 seconds.
|
||||||
|
Rudolph can fly 3 km/s for 15 seconds, but then must rest for 28 seconds.
|
||||||
|
Donner can fly 19 km/s for 9 seconds, but then must rest for 164 seconds.
|
||||||
|
Blitzen can fly 19 km/s for 9 seconds, but then must rest for 158 seconds.
|
||||||
|
Comet can fly 13 km/s for 7 seconds, but then must rest for 82 seconds.
|
||||||
|
Cupid can fly 25 km/s for 6 seconds, but then must rest for 145 seconds.
|
||||||
|
Dasher can fly 14 km/s for 3 seconds, but then must rest for 38 seconds.
|
||||||
|
Dancer can fly 3 km/s for 16 seconds, but then must rest for 37 seconds.
|
||||||
|
Prancer can fly 25 km/s for 6 seconds, but then must rest for 143 seconds.
|
||||||
1
internal/data/2016/DayFive/input.txt
Normal file
1
internal/data/2016/DayFive/input.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
reyedfim
|
||||||
1
internal/data/2018/DayFive/input.txt
Normal file
1
internal/data/2018/DayFive/input.txt
Normal file
File diff suppressed because one or more lines are too long
156
internal/data/2025/DayTen/input.txt
Normal file
156
internal/data/2025/DayTen/input.txt
Normal file
@@ -0,0 +1,156 @@
|
|||||||
|
[.#...#...#] (3,5,7,8) (0,3,4) (0,1,2,3,4,7,9) (0,1,3,4,6,7,9) (1,4,5,6,8) (0,1,6,9) (0,2,3,4,5,7,8,9) (1,2,5,6,7,9) (0,2,3,5,6,7,8,9) (0,2,3,4,5,7,8) {46,36,54,60,41,78,47,75,59,57}
|
||||||
|
[.#...#.] (0,1,2,3,4) (0,1,2,3,4,5) (3,5,6) (0,2,4,5) (1,2,5) (3) (0,3,4,5,6) (1,2,4,6) {48,163,178,40,179,32,133}
|
||||||
|
[##.##.###] (0,1,3,4,6,7,8) (1,4) (1,2,3,5) (3,7) (0,3,4,7) (0,3,8) (1,5,7) (1,2,3,4,5,6,7,8) {29,156,20,68,149,33,23,61,43}
|
||||||
|
[.###.] (1,2,4) (0,2,4) (0,1,3,4) (2,4) {23,23,40,3,43}
|
||||||
|
[...####.#.] (1,3,5,9) (0,1,2,3,5,6,7,8,9) (1,2,4,8) (4,6,8,9) (1,2,7) (1,2,7,9) (2,6) (9) (0,2,3,6,7,8,9) (0,1,4,5,6,7) (2,3,5,6,7,8) (2,3,4,5,7,8,9) (4,5,8) {18,56,78,48,75,58,55,52,83,73}
|
||||||
|
[..#..###] (0,1,2,3,6) (1) (0,1,2,3,4,7) (3,6) (3,5,6) (0,1,3,5,7) (1,3,5,6) {41,47,33,69,13,24,48,21}
|
||||||
|
[##.####...] (3,8) (1,5,7) (1,4,7,8,9) (0,2,3) (0,3,4,7,8,9) (1,2,4,5,6,7,8,9) (0,2,3,4,5,8,9) (0,1,3,4,7) (1,4) {31,56,25,36,50,41,11,48,30,25}
|
||||||
|
[#....#..#] (0,1,2,3,4,7) (4,5,8) (1,3) (1,2,8) (2,8) (0,4) (1,2,3,4,5,6,8) (0,2,3,6) (2,3,5,6,7) {28,40,41,45,39,22,21,16,26}
|
||||||
|
[.#.#] (0,1,2) (0,2,3) (2,3) (1,3) {12,0,12,12}
|
||||||
|
[#...#.] (1,3,4,5) (0,2,3,5) (0,1,2,4) (1,4,5) (1,2,3) {156,17,167,169,6,162}
|
||||||
|
[.##..] (0,1) (2,3) (0,1,2,4) (0,2,3,4) (1,2) (0,4) {36,23,36,21,28}
|
||||||
|
[.###] (0,1,2) (1,2) (2,3) (0,3) {16,11,13,9}
|
||||||
|
[####..#.#] (1) (0,4,6) (0,2,8) (1,8) (0,4,6,8) (0,2,4,5,6,7) (0,1,3,7) (0,1,2,3,4,6,7) (4,5,6,7) (1,2,6,7) {67,51,52,21,62,30,70,59,28}
|
||||||
|
[.####] (0,2) (0,2,4) (1,2,3) (1,2,3,4) {187,8,195,8,6}
|
||||||
|
[###..#] (1,2,4) (0,1,2,5) (1,2,3,5) (0,2,4,5) {31,167,186,146,28,177}
|
||||||
|
[##....#] (0,1,3,4,5,6) (0,1,3,5) (1,2,4) (1,2,3,5,6) (0,2) (1,5) {41,46,44,31,24,32,20}
|
||||||
|
[#.#.] (1,2) (1,3) (2,3) (2) (0,3) (0,1,2) {20,51,60,38}
|
||||||
|
[#.##..####] (0,2,3,4,5,6,7,9) (1,3) (1,2,3,4,6,7) (2,4) (0,2,4,5,6,9) (4,5,8) (0,3,4,9) (0,1,3,6,7,9) (0,1,4,7,8,9) (1,2,4,6,8) {48,58,62,58,83,12,67,41,21,48}
|
||||||
|
[..##] (2,3) (1,2,3) (3) (0,1,3) (0,1) {18,37,37,41}
|
||||||
|
[##.#.##.] (0,1,3,4,7) (0,6,7) (3,6) (0,1,2,3,4) (3,4) (0,1,2,3,5,6,7) {211,199,196,234,30,185,216,200}
|
||||||
|
[#...#.##] (1,4) (1,2,3,4,6,7) (0,3,4,5,7) (2,5) (0,1,2,4,6) (5) (1,4,5,7) (2,3,4,7) (1,5,6) {15,54,49,34,60,70,33,47}
|
||||||
|
[.#.#] (0,2,3) (1,3) {20,12,20,32}
|
||||||
|
[#..#.] (4) (0,3) (1,2) (0,2) (0,2,3) (2) {21,13,48,4,9}
|
||||||
|
[.######] (2,5) (0,2,3,5) (0,5,6) (4) (0,1,6) {45,18,22,9,18,40,36}
|
||||||
|
[##..#.#.#] (3,7) (1,5) (2,3) (0,1,2,3,4,6,8) (0,1,2,3,4,5,8) (6,8) (0,8) (1,2,8) (1,4,5) (0,1,3,5,6,7,8) (1,2,3,4,5,6,7) {37,61,43,33,21,30,26,7,55}
|
||||||
|
[#.##] (1,2,3) (0,1,2) (0,2,3) {18,2,18,16}
|
||||||
|
[...#] (0,1,3) (0) (0,1) (0,1,2) {46,34,8,15}
|
||||||
|
[.###..#.] (0,1,2,3,4,5) (4,7) (5,6) (1,2,3,5,6,7) (0,2,4,7) (1,2,3,6,7) (0,2,5,7) (1,2,3,4,6) (3,4,6,7) (0,2,3,4,7) {29,24,52,165,163,42,163,190}
|
||||||
|
[.#.###] (0,1,3,4,5) (3,4,5) (0,2) (1,4,5) (0,2,3) (1,2,4,5) {48,30,31,45,44,44}
|
||||||
|
[.....#...] (2,3,5) (1,2,3,5,7) (4) (0,3,4,6,7,8) (0,1,4,5,6,7) (4,5,6,7,8) (0,3,6,8) (0,1,3,4,6,7,8) (0,1,6,8) (1,2,5,8) (5) {63,64,34,57,217,221,225,221,225}
|
||||||
|
[#.#.#####] (4,5) (2,4,6,7,8) (3,5,6,8) (1,3,4,7,8) (0,2,4,5,6,7,8) (1,2,3,5,6,7,8) (1,8) (0,2,3,4,5) (0,6,8) {34,15,58,37,54,58,53,45,56}
|
||||||
|
[.#..#.] (3) (1,2,3,5) (0,4) (1,2,3) (0,2,4,5) (3,4) (0,1) (0,1,3,4) {190,199,34,195,185,18}
|
||||||
|
[##..#.###] (1,2,3,5,6,7) (4,6,8) (3,6,7) (3,5,6) (0,2,4,6,7,8) (0,5,6,7,8) (1,2,5) (0,1,2,4,6,8) (1,2,3,6,8) (0,6,7) {54,41,60,49,46,39,113,59,64}
|
||||||
|
[##.#####.#] (1,3,4,5,6,7,8,9) (4,6,7,8,9) (1,2,4,6) (0,3,4,6) (0,2,4,5,6,8) (0,1,2,5,8,9) (0,2,4,9) (0,1,4,5) {199,27,185,28,209,39,57,19,48,184}
|
||||||
|
[##..] (0) (0,3) (1,2) (1,2,3) (0,2,3) (0,1) {37,28,14,25}
|
||||||
|
[.....##..#] (0,1,3,4,5,7,8,9) (7) (0,2,4,8,9) (0,1,2,5,6,7) (0,1) (0,4,5,9) (6,9) (1,3,5,6,7,8,9) (0,1,2,5,7,9) (2,6) {39,38,37,7,8,34,46,44,8,50}
|
||||||
|
[.###.####.] (0,1,2,3,4,5,7,8,9) (4,9) (1,2,5,7,9) (0,1,2,3,5,6,7,8,9) (0,2,4,6,8,9) (2,3,4,6,9) (3,7,9) (8) (3,8) (0,1,4,5,6,7,8,9) (1,5,8) (0,1,3,4,5,8,9) {37,40,38,45,42,40,32,32,63,72}
|
||||||
|
[...#.#] (3,5) (0,1,2,5) (1,2) (0,3,4) {12,14,14,10,2,18}
|
||||||
|
[.###.] (0,2,4) (0,4) (2,3,4) (0,3) (1,2,3) {11,5,30,29,25}
|
||||||
|
[.#..#] (3) (1,3,4) (1) (2,4) (0,3) (0,2) (1,2,3,4) {28,25,43,31,29}
|
||||||
|
[##.##.] (0,1,3,4) (2,3,4) (0,1,4,5) (0,2,4,5) (0,1,2,3) (2) (1,3,5) (1) {41,54,43,59,36,17}
|
||||||
|
[#.....#] (0,1,3,6) (1,2,3,5) (0,1,2) (0,3,4,5,6) (0,4) {158,34,22,43,142,31,25}
|
||||||
|
[.#.#..#.] (0,1,2,4,6,7) (0,1,2,3,4,5) (1,5) (0,1,3,5,6,7) (0,1,2,3,4,5,7) (1,3,6,7) {207,233,190,213,190,221,29,40}
|
||||||
|
[.#.##] (0) (0,1) (1,2,3) (1,2,4) (2,4) {120,34,41,9,32}
|
||||||
|
[.#.#..##.] (1,2,4,6) (0,1,2,3,6,7,8) (2,3) (1,2,3,4,6,8) (0,7,8) (1,2,5,8) (0,2,5,6,8) {24,18,36,21,12,8,26,16,29}
|
||||||
|
[#..###.] (1,2,3,4,5,6) (0,2,4) (0,1,2,4) (3,5,6) (0,2,3,4,5,6) (0,3,5,6) (0,1,2,3,5,6) (4) (0,1,2,3,5) {77,44,66,199,46,199,190}
|
||||||
|
[...##..##] (1,2,3,5,6) (0,1,3,4,5,7) (1,2,3,4,5,7,8) (1,2,3,6,8) (0,1,6,7,8) (0,1,2,3,4,5,7) (0,2,3,4,8) (0,1) (1,2,3,4,5,7) (0,3,4,5,6) {75,122,93,109,78,80,57,77,68}
|
||||||
|
[.######.] (0,3) (0,3,4,5,7) (0,2,4,7) (2,3,5,7) (2,4) (0,1,2,3,4,7) (1,5,6) (5,6,7) {69,29,62,61,67,57,30,83}
|
||||||
|
[##.#.#.#.#] (0,3,4,6,7,8,9) (0,4,5,6,7) (2,4,6) (0,3,5,6) (1,4,5,9) (0,2,3,4,5,6,7,9) (3,5,8) (0,1,2,3,5,6,7,8,9) (1,5) (0,1,2,5,6,7,8,9) (4,8,9) {75,55,56,57,75,97,92,67,89,81}
|
||||||
|
[##...] (3) (2,3) (3,4) (0,1,2) (0,3) (1,4) (0,1,4) {25,31,36,35,20}
|
||||||
|
[.####...] (1,2,3,4,5,7) (1,4,5,6) (1,7) (1,5,6) (0,2,4,6) (0,3,4) (0,2,4,5,6) (2,5,6,7) (2,3,4,5,6,7) {37,56,77,44,75,87,79,68}
|
||||||
|
[..###.#] (1,2,4) (0,1,5) (1,3,5,6) (2,3,4,6) (0,2) (0,2,3,4,5,6) {193,41,194,36,35,47,36}
|
||||||
|
[.####.##.] (0,1,4,5,6,8) (0,1,3,4,8) (2,6,7) (2,3,4,5,6,7,8) (0,3,5,6,8) (0,1,2,3,4,6,7,8) (1,3,5,6,8) {37,29,6,39,17,42,48,6,49}
|
||||||
|
[.###.] (1,2) (0,1,3) (0,1) (0,1,4) {27,44,17,12,11}
|
||||||
|
[#..###..] (1,2,4,6,7) (0,1,4,7) (0,4,5) (0,5,7) (0,2,3,4,5,6) (0,1,3,5,6) (0,3,4,5,6) (2,4,6,7) (0,1,3,4,5,7) (3,7) {64,50,26,50,55,64,42,58}
|
||||||
|
[.####.#] (3,5,6) (0,1,4,6) (0,1,2,5,6) (2,4,6) (2,3,4) (0,1,3,4,6) (1) (0,1,2,3) {35,39,33,29,32,5,30}
|
||||||
|
[..#######.] (0,1,2,4,5,6,7,8) (3,4,6,8,9) (0,2,3,4,6,7,8,9) (0,1,3,7,9) (0,2,3,4,5,6,7,8) (0,2,4,5,6,7,8,9) (0,1,3,4,6,7,8) (3,5,8) (2,5,6,8) (0,1,2,3,5,6,9) (0,1,4,5,7,9) {63,45,22,67,61,46,45,62,60,57}
|
||||||
|
[##.#.] (1,2,4) (0,1,3) (0,1,4) {20,190,170,13,177}
|
||||||
|
[####..#.##] (1,4,8) (0,1,3,4,5,6,7,8) (1,3,4,9) (0,1,2,3,7,9) (1,3,4,6,7,8,9) (0,2,4,5,6,8) (0,3,4,5,9) (2,6,7) (0,1,2,4,5,6,7,8,9) (0,1,5) (1,2,8) (8) (2,3,4,5,6,7,8,9) {69,258,242,57,90,67,71,74,262,61}
|
||||||
|
[##.#] (0,1) (0,3) (2,3) (1,2,3) {33,27,21,37}
|
||||||
|
[#...###.##] (0,1,2,5,8,9) (5,6) (2,3,4,5,7) (3,4,8) (1,4,6,7,8) (1,6,8) (0,1,2,5,6,7,8) (1,2,4,5,7,9) (3,7,9) (2,8) (1,5,8) (0,1,2,3,4,5,6,8,9) (0,4,5,7,9) {71,97,88,63,90,129,70,78,125,64}
|
||||||
|
[..##.##.#.] (0,1,2,4,5,6,8,9) (1,2,3,4,5,6,7,9) (0,1,2,5,6,7,8,9) (0,1,2,3,5,8,9) (1,2,7,8) (0,6) (0,1,3,4,5,6,7,8) (0,3,4,5,7,9) (2,9) {79,74,70,46,50,78,52,64,71,74}
|
||||||
|
[.#..#...##] (1,3,6,9) (1,3,5,6,7,8,9) (2,3,4,5,7,8,9) (1,3,4,7,9) (1,2,3,4,5,6,9) (0,1,2,3,7,9) (3,6,9) (0,1,2,5,6,8,9) {12,179,160,196,149,168,187,29,24,200}
|
||||||
|
[##.###...] (4,5,7,8) (0,4,6,7,8) (3,4,7,8) (1,2,3,6,7,8) (2,3,5,6,7,8) (0,2,6) (0,1,2,5,6,7) (0,1,2,3,7,8) (1,4,5,7) (1,2) {38,38,49,37,47,40,37,76,60}
|
||||||
|
[.#.###] (0,1,3,5) (0,4) (2,3) (1,4) (2,3,4) {16,18,13,20,22,7}
|
||||||
|
[....#..#] (1,2) (0,2,3,5) (4,7) (3,5,6) (0,7) (0,2,4,5,6,7) (1,2,3,4,5,6,7) (3,4,5,6,7) {27,8,21,31,171,42,40,185}
|
||||||
|
[####] (1,2) (1,3) (0,1,2,3) {13,40,21,32}
|
||||||
|
[#.#.] (3) (0,2) (0) (0,3) (0,1) (1,3) {51,6,18,31}
|
||||||
|
[#.#.####..] (0,2,3,4,9) (1,5,9) (0,2,4,6) (3,5) (0,1,3,7,8,9) (2,5,6) (1,3,4,5,6,8,9) (2,3,7,8) (0,1,4,6,7,8) {48,39,41,65,53,38,40,22,40,54}
|
||||||
|
[.#...##] (0,2,6) (0,1,2,4,5) (0,3,4,6) (2,3,4,5,6) (1,2,3,4,5) (2,3,4,6) (1,5,6) {188,50,227,45,61,54,210}
|
||||||
|
[.#.#] (1,3) (2,3) (0,2) (0,3) (1) {22,26,21,16}
|
||||||
|
[#...##.#.] (0,1,4,8) (1,2,5,6,7) (0,3,4,5,6,8) (1,2,3,7,8) (0,1,2,3,4,5,6,7) (0,6,7,8) (0,1,2,3,4) (1,3,4,5,6,7,8) (4,5,6,8) {42,28,19,20,28,8,25,25,34}
|
||||||
|
[....#..#] (1,2,4,6) (1,2,3,5,6,7) (1,3) (0,1,3,4,5,6) (0,2,4,7) (1,2,4,5) (0,1,3,7) (0,1,2,3,4,5,6) (4,5,6,7) {28,193,172,188,18,168,169,174}
|
||||||
|
[#..#.##] (0,1,2,3,6) (1,2,4) (3,4,6) (0,1,2,4,5,6) (1,2,5) (0,1,5) (0,1,4,5) (1,2,3,4,6) (0,1,2,3,5,6) {23,44,32,31,49,25,42}
|
||||||
|
[#...#...#.] (0,1,3,5,7,8) (0,2,5,6,7,9) (0,1,3,6,7,9) (0,1,2,8) (0,4,8) (1,2,3,5,6) (0,1,2,4,5,6) (6,7,8) (2,9) (0,1,2,3,4,5,9) (7,9) {31,34,22,33,4,20,37,40,5,42}
|
||||||
|
[#.#.#.#.] (0,1,5,6,7) (0,5) (0,2,4,5,6,7) (0,2,6,7) (1,2,7) (0,5,6) (0,1,2,3,4,5) (3,4,5,7) {74,43,50,18,36,73,63,65}
|
||||||
|
[#..###..#.] (0,1,5,8) (2,3,4,5,7) (0,4,6,9) (7) (0,3,4,7,8,9) (0,2,3,4,9) (0,2,4,5,6,7,8,9) (3,4) (0,1,3,5,6,7,8,9) {41,11,23,37,40,25,21,50,26,39}
|
||||||
|
[..#...#..] (1,2,4,5) (2,3,4,5,6,8) (4,8) (0,1,2,4,5,6,7,8) (6,7,8) (0,3,7) (1,2,4,5,6,7,8) (2,6,7,8) (1,2,3,4,5,6,8) (0,1,4,5,7,8) {20,23,31,18,37,23,42,62,58}
|
||||||
|
[.#..##] (0,2,4,5) (0,5) (1,3,5) (2,4,5) (1,2,5) (0,1,4) (1,2,3,4) (1,2,4,5) {28,173,163,15,156,176}
|
||||||
|
[..##.#.] (3,5) (1,6) (1,4,5) (2,3,5) (0,1,2,4,5) (0,3,4,5,6) (0,1,6) (0,2,3,4,6) {192,198,29,36,34,55,180}
|
||||||
|
[.#...] (0,2,3,4) (3) (2,4) (2,3,4) (0,1,3) {20,5,23,39,23}
|
||||||
|
[.###.#.#.] (0,1,2,4,5,6,7) (0,1,5,6,8) (3,5,7,8) (1,2,4,8) (0,1,5,8) (2,3,4,7) (3,4,5,6,8) (0,1,2,3,4,6,7,8) {33,46,30,38,48,61,34,28,67}
|
||||||
|
[#.#.] (0,2) (0,1,3) {20,15,5,15}
|
||||||
|
[##.#] (1) (0,1) (0,2,3) (0,2) (1,3) (0) {175,26,160,156}
|
||||||
|
[#.#...] (0,1,2,5) (0,1,2,4,5) (1,3,4) (2,5) (0,1,2,3) (1) (1,4) {32,64,38,23,33,27}
|
||||||
|
[##..###] (0,1,2,4,5,6) (0,4,6) (0,1,2,3,4) (3,5) (0,2,3,4,5) (1,5,6) (1,6) {38,43,36,32,38,58,40}
|
||||||
|
[#...#...#.] (1,4,6,8,9) (0,1,2,3,8,9) (4,7,8) (1,2,3,5,7) (0,1,2,4,6,7,8) (0,4,6,9) (1,5,8) (1,2,3,5,6,7,8) (0,1,2,3,4,5,8,9) (0,1,2,3,4,5,7,8,9) (1,2,3,5,6,7,8,9) (1,3,8,9) {222,258,228,230,246,216,68,67,272,243}
|
||||||
|
[.#.#] (1,3) (0,2) {0,181,0,181}
|
||||||
|
[#...#..] (0,1,3,5) (0,2,3,4) (1,2,3,4,5,6) (1,3,5,6) (0,2,3,6) {34,20,19,39,19,20,5}
|
||||||
|
[..##..#] (2,3,6) (4,5) (0,2,4,5) (0,1,2,3,5) (0,6) (0,1,3,4) (1,2,3,5) (0,1,3,5) (1,5,6) {63,81,46,70,29,86,31}
|
||||||
|
[#.##] (1,2,3) (0,2,3) {8,11,19,19}
|
||||||
|
[..#.#.] (0,1) (0,2,4,5) (2,4) (0,1,2,3) (1,2) {33,34,47,7,20,19}
|
||||||
|
[##...####.] (0,6,8) (1,3,4,5,6,8,9) (0,1,2,3,4,5,7,8,9) (1,5,7) (2,5,7) (1,2,4,5,6,7,8) (6,7,8,9) (3,4,6,8) {19,41,30,162,166,51,157,39,173,36}
|
||||||
|
[...##.] (0,3,5) (0,1,3,5) (0,2) (5) (0,2,3,4,5) (3) (0,1,2,4,5) (3,4,5) {60,7,37,242,24,49}
|
||||||
|
[#..#.###.] (0,3,5,6,7) (0,1,2,3,5,7,8) (4,5) (0,1,4,6,7,8) (3,5,7) (0,1,2,6) (0,2,3,4,5,8) {36,26,22,20,25,31,22,24,23}
|
||||||
|
[.....#..##] (0,1,2,3,4,7,8,9) (4,5,7,9) (1,2,3,5,6,7,8,9) (0,2,6) (1,4,6,9) (0,7) (1,2,5,6,8,9) (1,2,4,8) (2,3,4,7,8) (0,1,3,5,7,8) (0,1,2,3,5,7,8,9) (0,1,2,3,4,5,6,7,8) (1,5,6,7,8,9) {61,127,89,74,48,100,78,106,123,85}
|
||||||
|
[#...#] (2,3,4) (1,4) (0,2,3) (0,4) {22,4,37,37,25}
|
||||||
|
[##.#.####.] (1,3,4,7,8) (0,1,2,3,5,6,7,9) (0,3,5) (1,2,3,4,7) (1,5) (3,4) (1,3,4,8,9) (1,5,6,9) (0,1,3,4,5,6,7) (2,7,8) (0,2,5,7) {45,68,47,75,45,72,28,59,19,25}
|
||||||
|
[.####] (1,2,3,4) (0,1,2,3,4) (2,4) {19,19,28,19,28}
|
||||||
|
[#.##.#] (0,1,2,3) (5) (1,3,4,5) (0,3,5) (0,2,3,5) (2,3,4,5) {25,8,25,45,20,50}
|
||||||
|
[..###] (3,4) (0,3) (0,2,3) (0,2,4) (0,1,2,4) (2,3,4) {44,20,49,54,54}
|
||||||
|
[.##.#] (0,3) (1,2,4) (0,1,2,3) (1,2,3) (4) (0,2,4) (0,1,3) {49,57,40,64,199}
|
||||||
|
[##.#..#..#] (3,6,8) (2,4,9) (1,2,3,4,5,6,7,8,9) (0,4,8) (1,2,4,5,6) (2,4,7,8) (1,3,4,6,8,9) (0,2,3,5,7,8,9) (1,2,4,6,7) (0,4,6,9) (6) (0,2,3,4,5,9) (0,6,7,8) {35,38,57,25,67,35,54,35,28,30}
|
||||||
|
[##...#] (0,1,5) (0,1,3,5) (0,2,3,5) (1,3,5) (1,2,3,4) (2,4) {31,44,36,36,25,50}
|
||||||
|
[..#.#..] (0,1,2,3,5) (1,3,4,5) (0,2,3,5,6) (0,1,2,6) (2,3,4,5,6) {16,19,36,41,25,41,22}
|
||||||
|
[#..##] (2,4) (0,2,3) (0,1,4) {6,5,10,1,14}
|
||||||
|
[##..###] (1,3,4,5) (3,4) (3,6) (0,1,2,3,4,6) (0,1,2,4,5) (0,2,4) (0,1,3,4,5) {36,43,28,49,53,28,24}
|
||||||
|
[#.###] (0,3) (1,3) (0,1,2) (0,3,4) (0,2,3) {37,25,18,32,3}
|
||||||
|
[.###.] (0,1,2) (0,1,4) (0,3) {25,11,2,14,9}
|
||||||
|
[..##..] (0,3,4) (0,1,5) (0,1,2,5) (2,5) (0,1,3) (0,3,4,5) {55,30,20,45,25,43}
|
||||||
|
[.##.#...] (3,4) (1,2,3) (0,3,4,6,7) (0,3,6,7) (0,1,4,6) (0,1,3) (0,2,3,4,5,6) {42,38,14,41,30,1,33,16}
|
||||||
|
[#.#....] (0,3,5,6) (4,6) (0,1,3,5) (0,1,3,4,6) (0,2,3,5) (2,3,4,5) (4,5,6) {60,30,201,241,223,230,52}
|
||||||
|
[...#..####] (0,1,3,6,7,9) (1,2,5,6,9) (5,6,8) (3,6,7) (2,5,6,7,9) (0,1,2,3,4,5,6,9) (1,3,4,6,8,9) (0,1,2,4,5,6,7,9) (1,4,6,9) (2,3,5,6,7,8) (0,2,3,6) (3,5,6,8) {59,89,84,93,59,86,149,79,35,97}
|
||||||
|
[..#####.] (0,2,3,4,5,7) (2,3,4,5,6) (1,3,4,5,7) (0,1,2,5,6,7) (4,5,6) (0,6,7) (0,1,4,5,7) {34,19,26,33,40,44,43,45}
|
||||||
|
[..#.] (0,1,3) (1,2) (2,3) (0,2) (1,3) {28,195,198,23}
|
||||||
|
[.####..] (2,4) (3,5) (0,2,5,6) (0,3,4,5,6) (1) (1,2,3,4,5) {26,12,19,24,25,34,26}
|
||||||
|
[##..#.#..] (2,4,7) (1,2,3,4,6) (3,8) (0,4,5,6,7,8) (2,4,8) (0,1,2,3,4,6,8) (4,5,8) (1,2) (0,2,5,7) {13,22,53,17,55,7,18,13,38}
|
||||||
|
[.###.##] (0,4,5) (0,2,3,4,5) (2,5) (1,2,3,4,5,6) (0,1,2,4,6) (1,2,4,6) (0,1,4,5,6) (0,1,2,6) (2,4) {56,38,82,8,72,50,38}
|
||||||
|
[..#.###] (0,1,2,3,4,6) (1,2) (0,1,2,6) (0,1,3,4,5) (1,3,4,6) (0,2,3) {47,57,46,46,31,12,34}
|
||||||
|
[.....#] (0,4) (0,2,4,5) (1,4,5) (1,3,5) (0,2,3,4) (4,5) (1,4) {13,43,13,29,54,58}
|
||||||
|
[.#...] (0,2,3,4) (3,4) (1,4) (1,2,3,4) (1,3,4) (1,2) {18,62,45,53,68}
|
||||||
|
[#.#.#.##.] (0,1,4,5,7) (0,2,3,5,6,7,8) (0,3,5,8) (2,3) (0,2,3,4,5,6,7,8) (0,1,4,5,6,8) (0,1,2,3,4,5,6) (0,1,2,3,5,6) (0,1,5,6,8) (0,1,2,3,5,6,7,8) (2,3,4,5,8) {88,62,55,67,42,90,69,24,55}
|
||||||
|
[###.] (1,2,3) (0,1,2) {10,29,29,19}
|
||||||
|
[#.##....] (0,3,4,5,6,7) (0,1,2,4) (1,6,7) (0,2,5,6,7) (0,1,3,6,7) (1,2,4,6,7) (3,4,7) (3,4,5,7) {36,37,20,30,26,15,41,54}
|
||||||
|
[...###...#] (0,1,3,4,5,6,7,8,9) (3,7,8) (1,2,3,5,6,7,9) (0,2) (0,2,4,5,7,8,9) (1,4,6,8,9) (0,2,3,4,5,6,9) (0,1,2,9) (1,8,9) {50,20,46,33,37,34,30,29,33,44}
|
||||||
|
[#.###...] (0,1,2,6,7) (0,3) (0,1,3,4,6) (4,6,7) (1,2,6) (1,5) (2,4) {149,152,18,146,165,1,171,23}
|
||||||
|
[.#...##] (0,1,3) (0,2,3,4,5,6) (0,4,5) (4) (0,2,3,4,5) (2,5,6) (1,5,6) (0,1,2,4,6) {55,42,54,39,45,64,55}
|
||||||
|
[##.######] (1,2,5,6,7) (0,1,2,6,8) (2,4) (1,2,3,5,6) (0,1,2,3,4,5,7) (0,2,3,5,6,7,8) (0,3,8) (2,3,7) {18,31,54,28,24,33,20,43,5}
|
||||||
|
[..#..#..] (1,2,3,4,6,7) (3,5) (0,2,3,6) (2,5) (3,4,5,6,7) (0,2,6) {20,10,42,38,16,36,36,16}
|
||||||
|
[####] (0,1,3) (1,2,3) (0,1,2) (0,1) (1,2) (1,3) {22,46,14,23}
|
||||||
|
[#.#..###.] (2,3,4,8) (0,1,4,5,8) (0,1,3,4,5,6,7,8) (1,2,3,4,8) (0,4,5,8) (0,2,5,7) (0,2,5,6) (5,6,7,8) {49,39,56,51,61,201,182,178,213}
|
||||||
|
[#..####.] (0,1) (0,4,5,6,7) (2,3,5,6) (2,3,4,6,7) (3,6) (1,2,4,5,6,7) (0,1,3,4,5,6,7) (0,3,4,5,6) (1,2,7) (0,1,2,4,5,6) {55,47,43,70,72,72,97,41}
|
||||||
|
[#.##..###] (0,3,5,6,7,8) (0,1,2,3,4,5,8) (0,1,4,6,7) (1,5,6,7,8) (2,4,6,8) (0,3,4,7) (0,6,7) {45,56,24,27,47,40,42,45,44}
|
||||||
|
[...##..#] (0,3,4,5,6,7) (0,5,6) (0,1,3,5,6,7) (0,2,4,5,6,7) (1,2,3,4,5,7) (0,1,2,3,5,6) {45,15,14,23,15,46,45,22}
|
||||||
|
[####.] (0,3,4) (0,4) (0,1,3,4) (3) (2,4) (1,3,4) (0,3) {41,29,18,54,67}
|
||||||
|
[#####.##] (0,2,3,4,5,6) (3,7) (0,5,6,7) (0,1,2,5,7) (1,3,6,7) (0,3,4,5,6) (0,1,2,4,6,7) (0,1,4,5) (1,2,3,4,6) {228,224,48,57,234,212,84,42}
|
||||||
|
[#.#.] (0,2,3) (0,2) (0,1) (2) (1,3) {24,1,199,14}
|
||||||
|
[#...##.#..] (4,6) (0,1,2,3,6,7,8,9) (1,2,3,4,6,8,9) (0,2,4,5,6,7) (1,2,4,7,8) (0,1) (9) (2,3,7) (0,1,3,4,8,9) (0,4,5,6) (0,1,3,4,6,7,8) (3,5,7,8) {56,45,47,209,70,207,65,233,217,16}
|
||||||
|
[......#.] (0,1,3,6) (2) (0) (1,3,4,5,6) (0,3) (2,3,4,6,7) (0,1,4,5,7) (0,2,3,4,7) (0,1,2,4,5,7) (0,5,7) {60,41,52,69,65,33,40,49}
|
||||||
|
[.#####] (1,3) (1,4) (1,4,5) (0,1,5) (2,4,5) {2,18,20,1,35,25}
|
||||||
|
[#..#....#.] (0,3,7,8,9) (1,8,9) (2,3,4,5) (0,1,3,5,6,7,8) (1,2,3,4,6,7,9) (2,7) (3,4) (0,2,4,5,7,8) {33,21,12,48,27,26,20,36,34,14}
|
||||||
|
[##..###.] (1,2,3,5) (0,1,2,3,5,7) (1,3,4,5,7) (0,1,5) (1,4,5,6) (2,5) (0,2,3,4,6,7) (0,3,6,7) {39,43,34,47,31,62,39,42}
|
||||||
|
[#.#.] (0,2) (0,2,3) (1,3) {23,18,23,28}
|
||||||
|
[#.#.####.#] (0,1,4,6) (1,4,7,8,9) (6,7) (1,3,5,6,7,8) (0,1,2) (0,2,4,6,9) (0,2,3,7) (1,3,7) (0,1,2,3,5,7,8) (2,3) {39,46,53,50,30,17,54,52,23,26}
|
||||||
|
[#..#.#.#.] (1,2,4,5,6,7,8) (0,2,3,4,6,7,8) (0,2,3,4,7,8) (0,6) (0,1,4,5,6,7) (1,2,3,6,7,8) (2,3,5,7,8) {159,43,190,170,179,53,60,205,190}
|
||||||
|
[##....] (0,2,3,5) (2,3,4) (0,4) (1,4) (0,1,2,5) (1,3,5) (0,5) {61,45,24,19,33,55}
|
||||||
|
[##..#.#.] (0,1,2,3,4,5) (0,1,2,3,4,7) (0,1,2,5,6) (0,1,2,3,4,5,6,7) (1,2) (1,5,6) (0,3) {49,56,48,34,20,33,25,12}
|
||||||
|
[...##.] (2,4) (1,3,4,5) (0,2,4,5) (2) (1) (2,3) (0,4,5) {18,12,48,23,25,22}
|
||||||
|
[..#..] (0,2,4) (0,1,3) (0,4) (0,1,2,3) {223,29,196,29,194}
|
||||||
|
[#.##...] (0,1,2,3) (1,5) (5) (4,5,6) (1,2,3,5) (0,2) (0,1,2,3,5,6) (1,2,5,6) (1,2,4,5,6) {42,69,65,34,23,75,57}
|
||||||
|
[#.##.] (1,4) (0,1,2,4) (0,2,3) (0,1,4) {34,24,26,10,24}
|
||||||
|
[#.#..#] (0,1,2,5) (0,2,4) (0,1,3,4,5) (0,1,3) {29,17,17,12,21,14}
|
||||||
|
[.#..###..] (6,7) (2,4,8) (1,2,3,4,5) (0,1,3,4) (2,3,6,7,8) (0,1,7) (6) (2,4,5,6,7) (0,7) (0,2,5,7) (1,2,4,5,7,8) {39,45,62,38,64,27,40,66,55}
|
||||||
|
[#.#.##] (0,4,5) (3,4) (2,3,4) (0,1,4,5) {37,20,155,155,192,37}
|
||||||
|
[.##.##] (0,1,2,3) (0,1,2,4) (1,2,3,5) (2,3) {134,145,153,22,131,11}
|
||||||
|
[.#.#] (0,2,3) (1,3) (2,3) {20,164,33,197}
|
||||||
Reference in New Issue
Block a user