7 kyu

The average length

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

Stats:

CreatedDec 27, 2017
PublishedDec 27, 2017
Warriors Trained1278
Total Skips6
Total Code Submissions2927
Total Times Completed954
JavaScript Completions954
Total Stars12
% of votes with a positive feedback rating94% of 308
Total "Very Satisfied" Votes278
Total "Somewhat Satisfied" Votes24
Total "Not Satisfied" Votes6
Total Rank Assessments4
Average Assessed Rank
7 kyu
Highest Assessed Rank
7 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • Dmitry Kudla Avatar
  • smile67 Avatar
  • ejini战神 Avatar
Ad