7 kyu
Sum Even Fibonacci Numbers
664 of 1,142AkyunaAkish
Description:
Sum Even Fibonacci Numbers
Write a func named SumEvenFibonacci that takes a parameter of type int and returns a value of type int
Generate all of the Fibonacci numbers starting with 1 and 2 and ending on the highest number before exceeding the parameter's value
Each new number in the Fibonacci sequence is generated by adding the previous two numbers - by starting with 1 and 2(the input could be smaller), the first 10 numbers will be:
1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...
- Sum all of the even numbers you generate and return that int
Example:
sumEvenFibonacci(8) // returns 10 by adding the even values 2 and 8
Fundamentals
Similar Kata:
Stats:
Created | May 25, 2017 |
Published | May 25, 2017 |
Warriors Trained | 2251 |
Total Skips | 117 |
Total Code Submissions | 5341 |
Total Times Completed | 1142 |
Go Completions | 664 |
Python Completions | 498 |
Total Stars | 25 |
% of votes with a positive feedback rating | 80% of 278 |
Total "Very Satisfied" Votes | 189 |
Total "Somewhat Satisfied" Votes | 69 |
Total "Not Satisfied" Votes | 20 |
Total Rank Assessments | 7 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 6 kyu |
Lowest Assessed Rank | 7 kyu |