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

Function Problem14

project_euler/problem_14/problem14.go:26–40  ·  view source on GitHub ↗
(limit uint64)

Source from the content-addressed store, hash-verified

24}
25
26func Problem14(limit uint64) uint64 {
27 for i := uint64(2); i <= limit; i++ {
28 weightNextNode(i)
29 }
30
31 var max, maxWeight uint64
32 for k, v := range dictionary {
33 if v > maxWeight {
34 max = k
35 maxWeight = v
36 }
37 }
38
39 return max
40}
41
42func weightNextNode(current uint64) uint64 {
43 var next, weight uint64

Callers 2

TestProblem14_FuncFunction · 0.85
BenchmarkProblem14_FuncFunction · 0.85

Calls 1

weightNextNodeFunction · 0.85

Tested by 2

TestProblem14_FuncFunction · 0.68
BenchmarkProblem14_FuncFunction · 0.68