7 kyu
N-Dimensional Vector Magnitude
392 of 954ByteSheep
Description:
Return the magnitude of a vector, given as an array of its component values.
The vector (2, 3, 5) would be represented as an array containing three values at indices 0, 1 and 2 respectively.
The array will always contain at least 2 and at most 100 elements (2 ≤ vector.Length ≤ 100), each of which will be within the range [-100, 100].
An array containing four elements represents a vector in 4D space.
More info on finding the length of a vector: http://farside.ph.utexas.edu/teaching/301/lectures/node28.html
Arrays
Fundamentals
Similar Kata:
Stats:
Created | Oct 19, 2016 |
Published | Oct 19, 2016 |
Warriors Trained | 1695 |
Total Skips | 94 |
Total Code Submissions | 1832 |
Total Times Completed | 954 |
C# Completions | 118 |
Java Completions | 219 |
JavaScript Completions | 195 |
Python Completions | 392 |
Ruby Completions | 46 |
PHP Completions | 83 |
Haskell Completions | 17 |
Total Stars | 17 |
% of votes with a positive feedback rating | 89% of 226 |
Total "Very Satisfied" Votes | 182 |
Total "Somewhat Satisfied" Votes | 38 |
Total "Not Satisfied" Votes | 6 |
Total Rank Assessments | 9 |
Average Assessed Rank | 7 kyu |
Highest Assessed Rank | 6 kyu |
Lowest Assessed Rank | 8 kyu |