7 kyu
Sort array by string length
24,858 of 50,396stevehopkinson
Description:
Write a function that takes an array of strings as an argument and returns a sorted array containing the same strings, ordered from shortest to longest.
For example, if this array were passed as an argument:
["Telescopes", "Glasses", "Eyes", "Monocles"]
Your function would return the following array:
["Eyes", "Glasses", "Monocles", "Telescopes"]
All of the strings in the array passed to your function will be different lengths, so you will not have to decide how to order multiple strings of the same length.
Sorting
Arrays
Fundamentals
Similar Kata:
Stats:
Created | Sep 27, 2016 |
Published | Sep 27, 2016 |
Warriors Trained | 73563 |
Total Skips | 7393 |
Total Code Submissions | 102925 |
Total Times Completed | 50396 |
JavaScript Completions | 24858 |
C# Completions | 2584 |
OCaml Completions | 159 |
C++ Completions | 3502 |
Python Completions | 16648 |
Ruby Completions | 1462 |
Scala Completions | 557 |
PHP Completions | 424 |
C Completions | 164 |
D Completions | 5 |
Rust Completions | 256 |
Go Completions | 597 |
CoffeeScript Completions | 11 |
Haskell Completions | 27 |
Total Stars | 525 |
% of votes with a positive feedback rating | 92% of 4635 |
Total "Very Satisfied" Votes | 3953 |
Total "Somewhat Satisfied" Votes | 598 |
Total "Not Satisfied" Votes | 84 |
Total Rank Assessments | 11 |
Average Assessed Rank | 7 kyu |
Highest Assessed Rank | 7 kyu |
Lowest Assessed Rank | 8 kyu |