Fix tabs
This commit is contained in:
@@ -1,26 +1,26 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"aoc2022/day13/common"
|
||||
"bufio"
|
||||
"fmt"
|
||||
"os"
|
||||
"sort"
|
||||
"aoc2022/day13/common"
|
||||
"bufio"
|
||||
"fmt"
|
||||
"os"
|
||||
"sort"
|
||||
)
|
||||
|
||||
func main() {
|
||||
packets := common.ParsePackets(*bufio.NewScanner(os.Stdin), []string{"[[2]]", "[[6]]"})
|
||||
|
||||
sort.Slice(packets, func(i int, j int) bool {
|
||||
return packets[i].Compare(packets[j]) < 0
|
||||
})
|
||||
sort.Slice(packets, func(i int, j int) bool {
|
||||
return packets[i].Compare(packets[j]) < 0
|
||||
})
|
||||
|
||||
result := 1
|
||||
for i := 0; i < len(packets); i++ {
|
||||
if packets[i].IsSeparator() {
|
||||
result *= (i+1)
|
||||
}
|
||||
}
|
||||
result := 1
|
||||
for i := 0; i < len(packets); i++ {
|
||||
if packets[i].IsSeparator() {
|
||||
result *= (i+1)
|
||||
}
|
||||
}
|
||||
|
||||
fmt.Println(result)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user