question 8 (question 8B does not work but I am tired)
This commit is contained in:
1 parent
bea4f844a8
commit
8198014f66
6 files changed
+312
-4
No files matched your search
@@ -1,3 +1,5 @@
|
||||
package main
|
||||
|
||||
const realInput = "...#........................................#........#.................#............#.#.......................#...............#..#\n...#........#.....#..................................................................................#......#..#..................\n.................#.......................#.#........#......#...........................................#...#..........#...........\n..................#..................#...#.....................................#........#.........................................\n...#.....#.......#..............#.#....##.............#....##......................................#...................#..........\n...#..........................................................................................................................#...\n..#..#.............#.....#...............#.......#..............................................#....#............................\n......................#..#...............#...................#....#..........................#...#............#...#....##.........\n..#.#.........#................#............#............#.#.......#................#....#..#.....................................\n.......................................................................#.....................................#...........#........\n...........#.....................................................................#.................................#......#.......\n...#.........#....................................................#..............#.............#..........#.......................\n.................................................................................................#................................\n..................................#.#.#...#.......#.............#.......................#..#.......................#.#............\n.......................#.........................................#..........#...#.....#....................................#......\n.......#.......#.#...........#......................#.....#..#...#.#...............#.............................#...#............\n............##...#......#.........#......#............................................................#.........#..............#..\n..#........................................#........##..#...............................................................#.........\n...........#..............##................................................................................#.....................\n..#................................................................................#..............#...............................\n...................................##..............#..........................#.......#..#...............#........#...............\n....#............#.........................#................................................................#........#............\n............#.....................................................................#.............................................#.\n............#..........#.......#...........#.#......#..............#.........#.......................................#......#.....\n..#...............................................#..................................#.............................#.............#\n.........................................................................#........#................#......#.......#....#........#.\n.......................................................................#.....##.................................................#.\n..............#.............#...........................#...#..#....................................................#.............\n.......#..........................#.......................###..................................#.....................#..#.........\n................#.................#.............#......................................................................#........#.\n.#.....#................#......................................................................#................#.................\n................................#........................#........#..#........................#...................................\n..............................................................................................#.....................#.........#...\n..................#.................#.........................#.....#................#............................................\n......#...................#...#...................#..................#...........................#......###...................#...\n.............................##.....#..............#..............................................................#....#..........\n......#..................#....................................................###....................#..............#.............\n............#...#..................#........#.............#..............................#......Line truncated
|
||||
|
||||
const mockInput = "....#.....\n.........#\n..........\n..#.......\n.......#..\n..........\n.#..^.....\n........#.\n#.........\n......#..."
|
||||
@@ -5,8 +5,6 @@ import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
const mockInput = "....#.....\n.........#\n..........\n..#.......\n.......#..\n..........\n.#..^.....\n........#.\n#.........\n......#..."
|
||||
|
||||
type Direction uint8
|
||||
|
||||
const (
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
package main
|
||||
|
||||
const realInput = "31084: 8 67 8 735 38\n40541461584: 5 81 9 4 32 43 283 228\n6208: 915 6 2 539 148 29\n306501986: 6 3 630 45 536 64 6\n21276000: 8 5 5 91 6 5 8 6 8 985 2 8\n1432991: 3 403 4 821 591 2 236\n17115994: 69 321 254 764 3 99\n19961295: 5 311 84 6 63\n22953531: 22 95 35 2 8\n18894343830: 90 5 3 2 65 7 159 2 91 1\n4312695565: 158 8 716 615 95 59\n391: 1 326 64\n25202: 8 5 62 1 401\n5324514: 6 8 466 59 169\n658234: 3 83 592 97 57 4\n26804472776473: 7 61 1 447 29 496 71 9\n1503368: 653 23 18 824 625\n24803314445: 5 2 4 4 417 1 987 4 447\n1021069871: 7 3 2 7 9 37 2 2 8 5 58\n1614: 63 645 4 3 31 868\n4258805: 68 532 78 91 5\n4495130022: 583 78 275 37 77\n45111648: 47 98 45 855 998 46 6\n2964501691711: 9 672 76 9 754 7 4 65\n90685578359: 906 855 782 33 126\n13608006: 3 5 7 7 3 602 7 4 7 720 6\n4645623: 66 863 5 615 8\n2569495: 443 74 7 71 5\n134484: 68 55 4 77 9 2 327 4\n1143450000: 24 750 35 264 5 1\n5449: 4 2 907 7\n23061783: 854 9 5 6 1 1 7 3 2 76 5\n2930: 18 6 7 555 5\n2115475: 9 194 8 54 42 5 31\n19449: 6 1 9 4 4 769 8 1 79 905\n4595553: 298 3 4 257 5 3 345 45\n208314087: 7 3 877 815 9 9 3 2 6 51\n2905504: 46 58 514 626 763\n963368: 48 425 484 6 370\n9980664: 1 98 80 5 98 68\n652568: 7 197 871 290 68\n45827: 15 3 665 9 154\n722: 2 21 337 5 357\n27652464029930: 7 829 9 700 7 9 3 7 4 1 8\n6868809: 45 2 9 848 9\n1175: 7 5 98\n2133: 17 2 5 36 5\n528: 55 1 5 8 9 31\n8206806: 1 4 9 4 99 6 24 97 2 5 6 5\n37530658373: 1 2 8 5 8 4 5 7 3 946 373\n65484738025: 47 5 4 43 8 6 43 7 7 26 5\n2157: 8 2 1 93 8 568\n23082508: 7 5 3 3 2 5 8 477 2 3 1 1\n29090880: 45 28 37 8 78\n1262763: 1 1 27 729 93 16 2 75\n1409848204234: 7 87 622 84 820 42 34\n3304: 6 55 4\n1196013120: 8 340 179 35 192\n124278235: 4 4 69 225 78 235\n2735190615: 273 2 3 1 906 1 5\n52192: 104 89 6 45 10 72\n573777850: 680 31 807 8 50\n35694425: 82 38 921 61 871 84 2\n658877085778: 7 86 55 156 10 977 8\n20860682976: 546 3 7 930 7 954 42 6\n224616: 441 46 8 36 73 8 3 45 7\n358087: 7 236 9 45 2 9 3 9 6 4 2 5\n6354432: 55 792 7 153 639 7\n1923524: 177 175 9 3 3 528 21\n117340: 9 82 159\n1234059: 64 357 9 45 6\n2651349895: 8 526 4 7 9 1 6 42 9 89 5\n3884759: 737 251 3 5 7\n633925731: 346 4 3 5 472 9 7 9 4 8 9\n43555: 37 4 60 25 53 77\n4230519: 2 2 12 8 9 9 91 41 2 5 2 3\n5489: 69 8 9 515 6\n82630872: 33 1 2 19 81 9 4 5 6 6 33\n203340489: 181 55 1 4 112 9\n72068: 7 197 4 5 9\n168389664: 1 683 84 5 667\n30367442: 2 657 6 4 384 5 673 49\n2846739576: 4 8 743 9 3 9 829 719 6\n78401: 77 4 9 93 5\n627886555182: 1 61 78 8 65 4 57 94 82\n53361: 85 3 592 1 63\n154268: 48 43 3 892 4 8 3 8 1\n525075263: 656 34 4 8 6 6\n248294606: 6 896 24 1 83 9 4 1 7 75\n9082152: 182 66 9 8 6 7 7 2 195 2\n1657909631: 8 5 76 7 5 95 2 9 22 544\n484430: 2 5 64 7 49 961 83 3\n11192683920: 6 26 7 8 5 8 6 3 8 372 1 1\n52887178: 4 863 61 118 60\n896861: 88 9 7 671 4 187\n721710054179: 135 891 60 541 81\n12403134: 92 6 34 58 6 5 7 9 6 6\n33615296: 312 44 55 9 3 1 572\n183192: 35 8 5 5 612 28 71 3 4 8\n1244794661146: 6 4 9 6 1 6 4 57 7 685 8 6\n362827266: 86 643 395 8 738 813\n1477891785: 86 6 2 8 13 2 91 7 1 8 8\n5983: 3 888 5 291 2 57 6\n73739569: 668 6 687 89 6 69\n902757501: 855 24 627 1 63 26 9\n177442819: 6 9 401 2 4 52 256 4 3\n87403263: 95 920 3 191 7 65\n223398085: 57 3 1 8 11 50 45 8 9 85\n76471: 81 472 2 1 6\n102739: 1 284 1 8 9 1\n98723250300: 79 119 1 1 2 143 5 7 21\n37813543: 28 4 5 813 540\n21449386021: 185 4 9 9 3 6 4 46 7 1 3 8\n355140846: 39 4 6 90 845\n25511824797: 3 7 4 746 48 55 3 15\n11681963: 5 76 9 67 1 35 3 8 50 3 2\n10812636790: 3 778 3 954 790\n144: 90 14 40\n2954988: 6 3 3 16 4 95 2 1 7 3 9 3\n1666626: 282 573 74 39 1 46\n380854191760: 2 7 24 5 54 177 5 5 664\n20485976: 47 155 643 323 3 8\n562264400: 8 1 3 1 5 74 3 67 309 88\n5054: 67 3 55 599 604\n5790: 8 6 4 3 7 43 1 9 8 4 17 6\n1423: 232 6 23 2 6\n2214885600: 1 5 2 1 3 50 183 41 82 3\n586061: 507 69 31 975 3\n68594249: 2 9 373 9 50 340 3 32 6\n380980: 95 4 980\n7510: 5 4 825 4 71 9\n451918: 90 50 18 11 106\n16294: 29 134 8 65 4 1 455 3\n10536237: 6 6 3 9 1 1 4 724 4 5 1 97\n24566372: 1 34 8 3 90 592 85 87\n284990: 5 5 5 91 7 5 88 5\n1108832032: 80 93 29 3 727 88\n215422984: 63 82 417 8 70 1\n37636247: 3 875 3 39 615 6 73 5 2\n511718662: 3 505 3 718 23 42 9\n172674894: 6 76 9 6 7 5 6 6 7 7 22 2\n2494298: 21 8 468 606 6\n1164891: 12 97 891\n1303421387: 8 604 17 5 6 48 95 87\n113169: 242 889 55 7 6\n28083319654: 7 1 6 2 780 4 8 9 9 3 8 7\n689769: 2 479 72 6\n664006: 603 60 997 9\n383810: 312 123 4 7\n278838736: 254 851 15 86 76\n35266920: 4 8 65 481 94\n2342060: 5 55 2 43 99 710\n61499384: 760 4 83 423 2 4\n1337677: 769 562 5 67 3 9 13\n20708670: 1 7 8 1 9 9 6 70 6 1 3 57\n22607703347: 23 6 7 6 7 67 80 39 44\n422584: 1 6 185 2 95 23 1 878\n16961283369: 7 614 720 9 609 1 9\n7743900: 12 80 8 38 33 75 525\n5198: 5 14 5 5 3\n7706: 5 765 6\n60799047884: 9 6 5 331 7 2 2 6 3 3 5 87\n373279812855: 74 65 5 946 16 571 5\n273426612: 519 24 87 2 656 3 958\n449: 250 94 8 9 88\n69949442: 8 92 4 1 15 33 8 3 1 2 2\n2540247614: 5Line truncated
|
||||
|
||||
const mockInput = "190: 10 19\n3267: 81 40 27\n83: 17 5\n156: 15 6\n7290: 6 8 6 15\n161011: 16 10 13\n192: 17 8 14\n21037: 9 7 18 13\n292: 11 6 16 20"
|
||||
@@ -6,8 +6,6 @@ import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
const mockInput = "190: 10 19\n3267: 81 40 27\n83: 17 5\n156: 15 6\n7290: 6 8 6 15\n161011: 16 10 13\n192: 17 8 14\n21037: 9 7 18 13\n292: 11 6 16 20"
|
||||
|
||||
type ProblemRow struct {
|
||||
res int
|
||||
numbers []int
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
package main
|
||||
|
||||
const mockInput = "............\n........0...\n.....0......\n.......0....\n....0.......\n......A.....\n............\n............\n........A...\n.........A..\n............\n............"
|
||||
const mockInput2 = `.....
|
||||
.....
|
||||
....d
|
||||
.....
|
||||
....d`
|
||||
const realInput = "....................8.D.........Y...........c.....\n....f.............D......O...........Y............\n.......z..........7.N..........g..................\n..........h...........9g.7....................Y...\n.............8...............................c....\n...9..8...............L........D....O.....l.......\n..........f.9.......h.........................l...\n...z...B..........................................\n.................M.....C.....OR7.Y..g..........l..\n........................M.......N.................\n...............h..................TD....H.........\n......z......M........C8.......N.......m.T........\n......O.......................................A...\n...........a...........h..........................\n................B..................j..............\n..............v..f..........g.....................\n.......N..........s.M.........n..............Q....\n...............s.........j.......................A\n......................a......................T...b\n........s....v......H..c..............j..i....m...\n.......................a........2H.......m..V.....\n................n.B..........o.....H......2.......\n.....3.......s.B..............x......S..K.........\n.3.G..................J................V...l.x..T.\n....3.......................E..................V..\n3..........................E..........V...i.......\n...............v.......n.E...................2.i..\n..F.........r.e......n....E...........A..Q.....K..\n..z................................A....Q.........\n.................................b..Q...d.Sw......\n..G...0..e............v.......Z...j.....m...b.....\n..y.............0.a.............................K.\n.............Gp....Z.................4......S.....\n....oJ....G........e.........Z............b.X.....\nC........o.r........WL..1.......X........K.....d..\n..................Z1.....r...............F........\n............L.4................1.6..............tF\n...y...............L......1............26.t.......\n......e.k......y........I......x......d........t.R\n.......0.........k...............d.........tWR..x.\n..........q.....r......J..................F..P..w.\n..........................5..........XwW..........\n...........0....y.............J.............6p....\n..q...k.......................I.....4........SR...\n.........q..o.......P................W............\n.............q.IP..............................p..\n.....k...................w.............X.......f..\n.............P...............4..................p.\n.................I..........5.....................\n.C.................................5...6.........."
|
||||
@@ -0,0 +1,299 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"math/big"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type Map struct {
|
||||
data []rune
|
||||
width int
|
||||
height int
|
||||
}
|
||||
type Point struct {
|
||||
x, y int
|
||||
}
|
||||
|
||||
func (p *Point) String() string {
|
||||
return fmt.Sprintf("(%d, %d)", p.x, p.y)
|
||||
}
|
||||
|
||||
func (p *Point) IsBetween(p1 *Point, p2 *Point) bool {
|
||||
return isBetween(p.x, p1.x, p2.x) && isBetween(p.y, p1.y, p2.y)
|
||||
|
||||
}
|
||||
|
||||
// Returns true is a is between (x, y) disregarding
|
||||
// x, y order ( (x,y) is considered an interval.
|
||||
// The definition of between includes both ends
|
||||
func isBetween(a int, x int, y int) bool {
|
||||
if x > y {
|
||||
return isBetween(a, y, x)
|
||||
}
|
||||
return x <= a && a <= y
|
||||
|
||||
}
|
||||
|
||||
func (p *Point) Dist(p2 *Point) *Vector {
|
||||
return NewVecFromInt(p2.x-p.x, p2.y-p.y)
|
||||
}
|
||||
|
||||
func NewVecFromInt(x, y int) *Vector {
|
||||
return &Vector{big.NewRat(int64(x), 1), big.NewRat(int64(y), 1)}
|
||||
}
|
||||
|
||||
type Vector struct {
|
||||
x, y *big.Rat
|
||||
}
|
||||
|
||||
func (v *Vector) String() string {
|
||||
return fmt.Sprintf("(%s, %s)", v.x, v.y)
|
||||
}
|
||||
|
||||
func (v *Vector) Time(n *big.Rat) *Vector {
|
||||
return &Vector{new(big.Rat).Mul(v.x, n), new(big.Rat).Mul(v.y, n)}
|
||||
}
|
||||
|
||||
func (v *Vector) Opp() *Vector {
|
||||
return v.Time(big.NewRat(-1, 1))
|
||||
}
|
||||
|
||||
func (v *Vector) Plus(vec2 *Vector) *Vector {
|
||||
return &Vector{new(big.Rat).Add(v.x, vec2.x), new(big.Rat).Add(v.y, vec2.y)}
|
||||
}
|
||||
|
||||
func (v *Vector) AsPoint() *Point {
|
||||
if !v.x.IsInt() || !v.y.IsInt() {
|
||||
panic("Not a point")
|
||||
}
|
||||
return &Point{int(v.x.Num().Int64()), int(v.y.Num().Int64())}
|
||||
}
|
||||
|
||||
func BaryCenter(p1, p2 *Point) *Vector {
|
||||
return &Vector{
|
||||
big.NewRat(int64(p1.x+p2.x), 2),
|
||||
big.NewRat(int64(p1.y+p2.y), 2),
|
||||
}
|
||||
}
|
||||
|
||||
func (m *Map) isInbound(point *Point) bool {
|
||||
return point.x >= 0 && point.x < m.width && point.y >= 0 && point.y < m.width
|
||||
}
|
||||
|
||||
func (m *Map) Get(point *Point) (rune, bool) {
|
||||
if !m.isInbound(point) {
|
||||
return 0, false
|
||||
}
|
||||
idx := point.x + m.width*point.y
|
||||
return m.data[idx], true
|
||||
}
|
||||
|
||||
func (m *Map) getByDataIndex(idx int) *Point {
|
||||
x := idx % m.width
|
||||
y := idx / m.width
|
||||
return &Point{x, y}
|
||||
}
|
||||
|
||||
func NewMap(input string) *Map {
|
||||
if !strings.HasSuffix(input, "\n") {
|
||||
input += "\n"
|
||||
}
|
||||
width := strings.Index(input, "\n")
|
||||
height := strings.Count(input, "\n")
|
||||
data := []rune(strings.ReplaceAll(input, "\n", ""))
|
||||
return &Map{data, width, height}
|
||||
}
|
||||
|
||||
func (m *Map) getAllAntennaFrequencies() <-chan rune {
|
||||
ch := make(chan rune)
|
||||
go func() {
|
||||
dejaVu := make(map[rune]bool)
|
||||
dejaVu['.'] = true
|
||||
for _, r := range m.data {
|
||||
if _, ok := dejaVu[r]; !ok {
|
||||
dejaVu[r] = true
|
||||
ch <- r
|
||||
}
|
||||
}
|
||||
close(ch)
|
||||
}()
|
||||
return ch
|
||||
}
|
||||
|
||||
func (m *Map) getAllAntennaOfFrequency(freq rune) []*Point {
|
||||
ret := make([]*Point, 0)
|
||||
for i, r := range m.data {
|
||||
if r == freq {
|
||||
ret = append(ret, m.getByDataIndex(i))
|
||||
}
|
||||
}
|
||||
return ret
|
||||
}
|
||||
|
||||
type AntennaPair struct {
|
||||
antenna1 *Point
|
||||
antenna2 *Point
|
||||
freq rune
|
||||
}
|
||||
|
||||
func (m *Map) getAllAntennaPairsOfFrequency(freq rune) <-chan *AntennaPair {
|
||||
antennas := m.getAllAntennaOfFrequency(freq)
|
||||
ch := make(chan *AntennaPair)
|
||||
go func() {
|
||||
for i := 0; i < len(antennas); i++ {
|
||||
for j := i + 1; j < len(antennas); j++ {
|
||||
ch <- &AntennaPair{antennas[i], antennas[j], freq}
|
||||
}
|
||||
}
|
||||
close(ch)
|
||||
|
||||
}()
|
||||
return ch
|
||||
}
|
||||
|
||||
func (m *Map) getEquidistantAntinodeLocationsForFreq(freq rune) <-chan *Point {
|
||||
ch := make(chan *Point)
|
||||
go func() {
|
||||
for p := range m.getAllAntennaPairsOfFrequency(freq) {
|
||||
bc := BaryCenter(p.antenna1, p.antenna2)
|
||||
dist := p.antenna1.Dist(p.antenna2).Time(big.NewRat(3, 2))
|
||||
antiNode1 := bc.Plus(dist).AsPoint()
|
||||
antiNode2 := bc.Plus(dist.Opp()).AsPoint()
|
||||
if m.isInbound(antiNode1) {
|
||||
ch <- antiNode1
|
||||
}
|
||||
if m.isInbound(antiNode2) {
|
||||
ch <- antiNode2
|
||||
}
|
||||
}
|
||||
close(ch)
|
||||
}()
|
||||
|
||||
return ch
|
||||
}
|
||||
|
||||
func (m *Map) generateInlinePoints(p *Point, stepX, stepY int, filter func(*Point) bool, ch chan<- *Point) {
|
||||
for {
|
||||
p = &Point{p.x + stepX, p.y + stepY}
|
||||
if !m.isInbound(p) {
|
||||
return
|
||||
}
|
||||
if filter(p) {
|
||||
ch <- p
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
func (m *Map) getStep(p *AntennaPair) (int, int) {
|
||||
dist := p.antenna1.Dist(p.antenna2)
|
||||
if dist.x.Cmp(big.NewRat(0, 1)) == 0 {
|
||||
return 0, 1
|
||||
}
|
||||
if dist.y.Cmp(big.NewRat(0, 1)) == 0 {
|
||||
return 1, 0
|
||||
}
|
||||
step := new(big.Rat).Quo(dist.y, dist.x)
|
||||
stepX := int(step.Denom().Int64())
|
||||
stepY := int(step.Num().Int64())
|
||||
if stepX < 0 {
|
||||
stepX = -stepX
|
||||
}
|
||||
return stepX, stepY
|
||||
}
|
||||
|
||||
func (m *Map) getCollinearAntinodeLocationsFreq(freq rune) <-chan *Point {
|
||||
ch := make(chan *Point)
|
||||
go func() {
|
||||
for pair := range m.getAllAntennaPairsOfFrequency(freq) {
|
||||
stepX, stepY := m.getStep(pair)
|
||||
filter := func(p *Point) bool {
|
||||
return !p.IsBetween(pair.antenna1, pair.antenna2)
|
||||
}
|
||||
m.generateInlinePoints(pair.antenna1, stepX, stepY, filter, ch)
|
||||
m.generateInlinePoints(pair.antenna1, -stepX, -stepY, filter, ch)
|
||||
|
||||
}
|
||||
close(ch)
|
||||
}()
|
||||
|
||||
return ch
|
||||
}
|
||||
|
||||
func dedupPoints(points <-chan *Point) <-chan *Point {
|
||||
ch := make(chan *Point)
|
||||
go func() {
|
||||
m := make(map[int]map[int]bool)
|
||||
for p := range points {
|
||||
if _, ok := m[p.x]; ok {
|
||||
if _, ok2 := m[p.x][p.y]; ok2 {
|
||||
continue
|
||||
}
|
||||
m[p.x][p.y] = true
|
||||
} else {
|
||||
m[p.x] = make(map[int]bool)
|
||||
m[p.x][p.y] = true
|
||||
}
|
||||
ch <- p
|
||||
}
|
||||
close(ch)
|
||||
}()
|
||||
|
||||
return ch
|
||||
|
||||
}
|
||||
|
||||
func (m *Map) getAllEquidistantAntinodeLocations() <-chan *Point {
|
||||
ch := make(chan *Point)
|
||||
go func() {
|
||||
for freq := range m.getAllAntennaFrequencies() {
|
||||
for p := range m.getEquidistantAntinodeLocationsForFreq(freq) {
|
||||
ch <- p
|
||||
}
|
||||
}
|
||||
close(ch)
|
||||
}()
|
||||
return dedupPoints(ch)
|
||||
}
|
||||
|
||||
func (m *Map) getAllCollinearAntinodeLocations() <-chan *Point {
|
||||
ch := make(chan *Point)
|
||||
go func() {
|
||||
for freq := range m.getAllAntennaFrequencies() {
|
||||
for p := range m.getCollinearAntinodeLocationsFreq(freq) {
|
||||
ch <- p
|
||||
}
|
||||
}
|
||||
close(ch)
|
||||
}()
|
||||
return dedupPoints(ch)
|
||||
}
|
||||
|
||||
func question8A(input string) int {
|
||||
i := 0
|
||||
m := NewMap(input)
|
||||
for _ = range m.getAllEquidistantAntinodeLocations() {
|
||||
i++
|
||||
}
|
||||
return i
|
||||
|
||||
}
|
||||
|
||||
func question8B(input string) int {
|
||||
i := 0
|
||||
m := NewMap(input)
|
||||
for _ = range m.getAllCollinearAntinodeLocations() {
|
||||
//fmt.Println(">> ", p)
|
||||
i++
|
||||
}
|
||||
return i
|
||||
|
||||
}
|
||||
|
||||
func main() {
|
||||
|
||||
fmt.Printf("The answer to question 8A is %d \n", question8A(realInput))
|
||||
fmt.Printf("The answer to question 8B is %d \n", question8B(mockInput))
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user