Add solution for Day 1

This commit is contained in:
2021-12-01 14:03:38 +00:00
parent 3d206d4d45
commit d41d58d2cf
4 changed files with 2129 additions and 3 deletions

View File

@@ -1,16 +1,24 @@
package one
import "fmt"
type One struct {
radar radar
}
func Init(filepath string) *One {
return nil
one := &One{
radar: radar{},
}
one.radar.scan(filepath)
return one
}
func (d *One) Answer() string {
return "Hello"
return fmt.Sprintf("There were %d increases in depth", d.radar.depthIncreases())
}
func (d *One) FollowUp() string {
return "World!"
return fmt.Sprintf("There were %d increases in depth when sampling a window", d.radar.windowedDepthIncreases())
}