UVO2RZ3EHNYSMDW7CDZBA3WBDWASVBXJQ45HVTWBG3BGUYU2REJAC
return fmt.Errorf("%d should be %d", got, want)
return fmt.Errorf("Test1: %d should be %d", got, want)
}
return nil
}
func Test2(input string) error {
var ret []string
input = strings.TrimSpace(input)
for _, line := range strings.Split(input, "\n") {
ret = append(ret, strings.TrimSpace(line))
func countThreeIncrease(data []string) (int, error) {
var inc int
for i := range data {
if i >= 3 {
// log.Println(sum(data, i-1), sum(data, i))
if sum(data, i-1) < sum(data, i) {
inc++
}
}
}
return inc, nil
}
func sum(data []string, k int) int {
var ret int
for i := k - 2; i <= k; i++ {
curr, err := strconv.Atoi(data[i])
if err != nil {
log.Println(err)
}
ret += curr
}
return ret
}