7 kyu
The average length
954Dmitry Kudla
Description:
Given an array of strings of the same letter type. Return a new array, which will differ in that the length of each element is equal to the average length of the elements of the previous array.
A few examples:
['u', 'y'] => ['u', 'y'] // average length is 1
['aa', 'bbb', 'cccc'] => ['aaa', 'bbb', 'ccc'] // average length is 3
['aa', 'bb', 'ddd', 'eee'] => ['aaa', 'bbb', 'ddd', 'eee'] // average length is 2.5 round up to 3
- If the average length is not an integer, use Math.round().
- The input array's length > 1
Fundamentals
Strings
Arrays
Similar Kata:
Stats:
Created | Dec 27, 2017 |
Published | Dec 27, 2017 |
Warriors Trained | 1278 |
Total Skips | 6 |
Total Code Submissions | 2927 |
Total Times Completed | 954 |
JavaScript Completions | 954 |
Total Stars | 12 |
% of votes with a positive feedback rating | 94% of 308 |
Total "Very Satisfied" Votes | 278 |
Total "Somewhat Satisfied" Votes | 24 |
Total "Not Satisfied" Votes | 6 |
Total Rank Assessments | 4 |
Average Assessed Rank | 7 kyu |
Highest Assessed Rank | 7 kyu |
Lowest Assessed Rank | 7 kyu |