CXCSWSY2MXXWPQWBDYDWHU5FYQUV5Q4XTMESCJ5LBYKSP4W2UV2AC
UQCJGDY6OFMAMZMQMLJAZLZMW6UQJAOYXTXOTKR7FPEEI33LGOQQC
for scanNo, sd := range sds {
for scanNo := range sds {
for _, sl := range sd.beacons {
for _, sl := range sds[scanNo].beacons {
sd.sPos = scanLine{-tmp.x, -tmp.y, -tmp.z} for _, line := range sd.beacons {
sd.sPos = scanLine{-tmp.x, -tmp.y, -tmp.z}
for _, line := range sd.beacons {
sds[scanNo].sPos = scanLine{-tmp.x, -tmp.y, -tmp.z} for _, line := range sds[scanNo].beacons {
sds[scanNo].sPos = scanLine{-tmp.x, -tmp.y, -tmp.z}
for _, line := range sds[scanNo].beacons {
var max int for _, first := range sds { for _, second := range sds { if d := distance(first.sPos, second.sPos); d > max { max = d } } } log.Println(max)
var max int
for _, first := range sds {
for _, second := range sds {
if d := distance(first.sPos, second.sPos); d > max {
max = d
}
log.Println(max)
}func distance(first, second scanLine) int { return abs(first.x-second.x) + abs(first.y-second.y) + abs(first.z-second.z)
func distance(first, second scanLine) int {
return abs(first.x-second.x) + abs(first.y-second.y) + abs(first.z-second.z)
func abs(in int) int { if in < 0 { return -in } return in}
func abs(in int) int {
if in < 0 {
return -in
return in