about | help | code help+videos | done | prefs |
fibonacci
The fibonacci sequence is: 1, 1, 2, 3, 5, 8, 13, 21, and so on, where the first two numbers are 1 and 1, and then each of the remaining numbers is computed by adding the previous two numbers. For example, the 8th fibonacci number is 21 because it is the sum of 8 and 13. Implement a method that returns the nth fibonacci number. fibonacci(1) → 1 fibonacci(2) → 1 fibonacci(5) → 5 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 200
Copyright Nick Parlante 2017 - privacy