add duration output
This commit is contained in:
parent
9244b2e178
commit
24b59f71fa
@ -5,11 +5,16 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
start := time.Now()
|
||||||
partOne()
|
partOne()
|
||||||
|
duration := time.Since(start)
|
||||||
partTwo()
|
partTwo()
|
||||||
|
duration2 := time.Since(start)
|
||||||
|
fmt.Printf("p1: %s, p2: %s\n", duration, duration2-duration)
|
||||||
}
|
}
|
||||||
|
|
||||||
// [...] they need you to find the two entries that sum to 2020 and then multiply those two numbers together.
|
// [...] they need you to find the two entries that sum to 2020 and then multiply those two numbers together.
|
||||||
|
@ -6,12 +6,17 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
"time"
|
||||||
"unicode"
|
"unicode"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
start := time.Now()
|
||||||
partOne()
|
partOne()
|
||||||
|
duration := time.Since(start)
|
||||||
partTwo()
|
partTwo()
|
||||||
|
duration2 := time.Since(start)
|
||||||
|
fmt.Printf("p1: %s, p2: %s\n", duration, duration2-duration)
|
||||||
}
|
}
|
||||||
|
|
||||||
//To try to debug the problem, they have created a list (your puzzle input) of passwords (according to the corrupted database) and the corporate policy when that password was set.
|
//To try to debug the problem, they have created a list (your puzzle input) of passwords (according to the corrupted database) and the corporate policy when that password was set.
|
||||||
|
@ -5,11 +5,16 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
start := time.Now()
|
||||||
partOne()
|
partOne()
|
||||||
|
duration := time.Since(start)
|
||||||
partTwo()
|
partTwo()
|
||||||
|
duration2 := time.Since(start)
|
||||||
|
fmt.Printf("p1: %s, p2: %s\n", duration, duration2-duration)
|
||||||
}
|
}
|
||||||
|
|
||||||
type slope struct {
|
type slope struct {
|
||||||
|
@ -6,11 +6,16 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
start := time.Now()
|
||||||
partOne()
|
partOne()
|
||||||
|
duration := time.Since(start)
|
||||||
partTwo()
|
partTwo()
|
||||||
|
duration2 := time.Since(start)
|
||||||
|
fmt.Printf("p1: %s, p2: %s\n", duration, duration2-duration)
|
||||||
}
|
}
|
||||||
|
|
||||||
type passport struct {
|
type passport struct {
|
||||||
|
@ -5,11 +5,16 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"sort"
|
"sort"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
start := time.Now()
|
||||||
partOne()
|
partOne()
|
||||||
|
duration := time.Since(start)
|
||||||
partTwo()
|
partTwo()
|
||||||
|
duration2 := time.Since(start)
|
||||||
|
fmt.Printf("p1: %s, p2: %s\n", duration, duration2-duration)
|
||||||
}
|
}
|
||||||
|
|
||||||
type boardingPass struct {
|
type boardingPass struct {
|
||||||
|
@ -5,11 +5,16 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"strings"
|
"strings"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
start := time.Now()
|
||||||
partOne()
|
partOne()
|
||||||
|
duration := time.Since(start)
|
||||||
partTwo()
|
partTwo()
|
||||||
|
duration2 := time.Since(start)
|
||||||
|
fmt.Printf("p1: %s, p2: %s\n", duration, duration2-duration)
|
||||||
}
|
}
|
||||||
|
|
||||||
func union(s string) string {
|
func union(s string) string {
|
||||||
|
@ -6,11 +6,16 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
start := time.Now()
|
||||||
partOne()
|
partOne()
|
||||||
|
duration := time.Since(start)
|
||||||
partTwo()
|
partTwo()
|
||||||
|
duration2 := time.Since(start)
|
||||||
|
fmt.Printf("p1: %s, p2: %s\n", duration, duration2-duration)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Bag is a bag that contains other bags
|
// Bag is a bag that contains other bags
|
||||||
|
@ -6,11 +6,16 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
start := time.Now()
|
||||||
partOne()
|
partOne()
|
||||||
|
duration := time.Since(start)
|
||||||
partTwo()
|
partTwo()
|
||||||
|
duration2 := time.Since(start)
|
||||||
|
fmt.Printf("p1: %s, p2: %s\n", duration, duration2-duration)
|
||||||
}
|
}
|
||||||
|
|
||||||
type opCode struct {
|
type opCode struct {
|
||||||
|
@ -6,11 +6,16 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"sort"
|
"sort"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
start := time.Now()
|
||||||
partOne()
|
partOne()
|
||||||
|
duration := time.Since(start)
|
||||||
partTwo()
|
partTwo()
|
||||||
|
duration2 := time.Since(start)
|
||||||
|
fmt.Printf("p1: %s, p2: %s\n", duration, duration2-duration)
|
||||||
}
|
}
|
||||||
|
|
||||||
func checkNotSum(t int, s []int) bool {
|
func checkNotSum(t int, s []int) bool {
|
||||||
|
@ -6,11 +6,16 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"sort"
|
"sort"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
start := time.Now()
|
||||||
partOne()
|
partOne()
|
||||||
|
duration := time.Since(start)
|
||||||
partTwo()
|
partTwo()
|
||||||
|
duration2 := time.Since(start)
|
||||||
|
fmt.Printf("p1: %s, p2: %s\n", duration, duration2-duration)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Find a chain that uses all of your adapters to connect the charging outlet to your device's built-in adapter
|
// Find a chain that uses all of your adapters to connect the charging outlet to your device's built-in adapter
|
||||||
|
@ -4,11 +4,16 @@ import (
|
|||||||
"bufio"
|
"bufio"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
start := time.Now()
|
||||||
partOne()
|
partOne()
|
||||||
|
duration := time.Since(start)
|
||||||
partTwo()
|
partTwo()
|
||||||
|
duration2 := time.Since(start)
|
||||||
|
fmt.Printf("p1: %s, p2: %s\n", duration, duration2-duration)
|
||||||
}
|
}
|
||||||
|
|
||||||
type cell struct {
|
type cell struct {
|
||||||
|
Loading…
Reference in New Issue
Block a user