7 kyu

Flatten and sort an array

13,191 of 30,155lilsweetcaligula

Description:

Challenge:

Given a two-dimensional array of integers, return the flattened version of the array with all the integers in the sorted (ascending) order.

Example:

Given [[3, 2, 1], [4, 6, 5], [], [9, 7, 8]], your function should return [1, 2, 3, 4, 5, 6, 7, 8, 9].

Addendum:

Please, keep in mind, that JavaScript is by default sorting objects alphabetically. For more information, please consult:

http://stackoverflow.com/questions/6093874/why-doesnt-the-sort-function-of-javascript-work-well

Arrays
Sorting
Fundamentals

Stats:

CreatedSep 30, 2016
PublishedSep 30, 2016
Warriors Trained43052
Total Skips3507
Total Code Submissions73447
Total Times Completed30155
JavaScript Completions13191
Python Completions9122
Crystal Completions37
Ruby Completions1111
Elixir Completions317
Haskell Completions315
PHP Completions861
Java Completions2372
TypeScript Completions835
Dart Completions947
CoffeeScript Completions18
Julia Completions59
Swift Completions1341
F# Completions39
C Completions120
COBOL Completions5
Rust Completions250
Total Stars337
% of votes with a positive feedback rating93% of 3085
Total "Very Satisfied" Votes2685
Total "Somewhat Satisfied" Votes352
Total "Not Satisfied" Votes48
Total Rank Assessments10
Average Assessed Rank
7 kyu
Highest Assessed Rank
6 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • lilsweetcaligula Avatar
  • GiacomoSorbi Avatar
  • user8476848 Avatar
  • siebenschlaefer Avatar
  • Chrono79 Avatar
  • kazk Avatar
  • JohanWiltink Avatar
  • wneumann Avatar
  • neilm Avatar
  • kingcobra Avatar
  • sfabruz Avatar
  • monadius Avatar
  • Awesome A.D. Avatar
  • hobovsky Avatar
  • cliffstamp Avatar
  • GabeAtWork Avatar
  • trashy_incel Avatar
  • user8436785 Avatar
  • ejini战神 Avatar
  • akar-0 Avatar
Ad