Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
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
12
package
problem1
13
14
func
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_Func
Function · 0.85
BenchmarkProblem1
Function · 0.85
Calls
no outgoing calls
Tested by
2
TestProblem1_Func
Function · 0.68
BenchmarkProblem1
Function · 0.68