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

Function Problem1

project_euler/problem_1/problem1.go:14–24  ·  view source on GitHub ↗
(n uint)

Source from the content-addressed store, hash-verified

12package problem1
13
14func Problem1(n uint) uint {
15 sum := uint(0)
16
17 for i := uint(1); i < n; i++ {
18 if i%3 == 0 || i%5 == 0 {
19 sum += i
20 }
21 }
22
23 return sum
24}

Callers 2

TestProblem1_FuncFunction · 0.85
BenchmarkProblem1Function · 0.85

Calls

no outgoing calls

Tested by 2

TestProblem1_FuncFunction · 0.68
BenchmarkProblem1Function · 0.68