7 kyu
Predict your age!
1,022 of 24,339Torkel
Description:
My grandfather always predicted how old people would get, and right before he passed away he revealed his secret!
In honor of my grandfather's memory we will write a function using his formula!
- Take a list of ages when each of your great-grandparent died.
- Multiply each number by itself.
- Add them all together.
- Take the square root of the result.
- Divide by two.
Example
predictAge(65, 60, 75, 55, 60, 63, 64, 45) === 86
Note: the result should be rounded down to the nearest integer.
Some random tests might fail due to a bug in the JavaScript implementation. Simply resubmit if that happens to you.
Fundamentals
Similar Kata:
Stats:
Created | May 18, 2018 |
Published | May 18, 2018 |
Warriors Trained | 34922 |
Total Skips | 4045 |
Total Code Submissions | 58455 |
Total Times Completed | 24339 |
JavaScript Completions | 7751 |
Python Completions | 6392 |
Ruby Completions | 634 |
Clojure Completions | 167 |
C++ Completions | 1792 |
CoffeeScript Completions | 18 |
Julia Completions | 154 |
Groovy Completions | 69 |
Java Completions | 2513 |
PHP Completions | 748 |
Kotlin Completions | 1022 |
C# Completions | 939 |
R Completions | 228 |
Lua Completions | 308 |
F# Completions | 102 |
C Completions | 746 |
NASM Completions | 17 |
Crystal Completions | 25 |
TypeScript Completions | 508 |
Scala Completions | 293 |
Dart Completions | 705 |
Total Stars | 245 |
% of votes with a positive feedback rating | 85% of 2841 |
Total "Very Satisfied" Votes | 2162 |
Total "Somewhat Satisfied" Votes | 523 |
Total "Not Satisfied" Votes | 156 |
Total Rank Assessments | 5 |
Average Assessed Rank | 7 kyu |
Highest Assessed Rank | 7 kyu |
Lowest Assessed Rank | 8 kyu |