MCPcopy Create free account
hub / github.com/TheAlgorithms/Go / Problem17

Function Problem17

project_euler/problem_17/problem17.go:21–31  ·  view source on GitHub ↗
(input string)

Source from the content-addressed store, hash-verified

19import "strings"
20
21func Problem17(input string) int {
22 var sum int
23
24 parsed := strings.Split(input, " ")
25
26 for _, word := range parsed {
27 sum += len(word)
28 }
29
30 return sum
31}

Callers 2

TestProblem17_FuncFunction · 0.85
BenchmarkProblem17_FuncFunction · 0.85

Calls 1

SplitMethod · 0.80

Tested by 2

TestProblem17_FuncFunction · 0.68
BenchmarkProblem17_FuncFunction · 0.68