Day 14 solution

This commit is contained in:
2021-12-14 15:41:16 +00:00
parent 000e241684
commit 6b21ea4aff
7 changed files with 374 additions and 0 deletions

24
fourteen/main.go Normal file
View File

@@ -0,0 +1,24 @@
package fourteen
import "fmt"
type Fourteen struct {
polymer polymer
}
func Init(filepath string) *Fourteen {
fourteen := &Fourteen{
polymer: polymer{},
}
fourteen.polymer.load(filepath)
return fourteen
}
func (d *Fourteen) Answer() string {
return fmt.Sprintf("The result of subtracting the least from most common element quantities is %d", d.polymer.elementCount(10))
}
func (d *Fourteen) FollowUp() string {
return fmt.Sprintf("The result of subtracting the least from most common element quantities is %d", d.polymer.elementCountMap(40))
}