Commits

Miki Tebeka committed f3b6a9e

Return list of elements

Comments (0)

Files changed (1)

 	"strconv"
 )
 
-func fib(n int) int {
+func fib(n int) []int {
+	fibs := make([]int, n)
 	a, b := 1, 1
 	for i := 0; i < n-1; i++ {
+		fibs[i] = a
 		a, b = b, a+b
 	}
+	fibs[n-1] = a
 
-	return b
+	return fibs
 }
 
 func main() {