You are viewing a single comment's thread. Return to all comments →
Golang Solution
func fibonacci(n uint64) uint64 { var a, b, sum uint64 = 1, 2, 2 for a + b < n { next := a + b if next % 2 == 0 { sum += next } a = b b = next } return sum }
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #2: Even Fibonacci numbers
You are viewing a single comment's thread. Return to all comments →
Golang Solution