Actually output the answer

This commit is contained in:
Brian Buller 2018-12-01 23:25:41 -06:00
parent 97d81128f1
commit 613364fcd4

View File

@ -39,18 +39,18 @@ func part2(inp []string) {
if v1 == v2 { if v1 == v2 {
continue continue
} }
var diff int var diff, diffIdx int
for k := range v1 { for k := range v1 {
if v1[k] != v2[k] { if v1[k] != v2[k] {
diff++ diff++
diffIdx = k
} }
if diff > 1 { if diff > 1 {
continue continue
} }
} }
if diff == 1 { if diff == 1 {
fmt.Println(v1) fmt.Println(v1[:diffIdx] + v1[diffIdx+1:])
fmt.Println(v2)
return return
} }
} }