7 kyu

Flatten and sort an array

12,986 of 29,538lilsweetcaligula

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 Trained42286
Total Skips3456
Total Code Submissions72174
Total Times Completed29538
JavaScript Completions12986
Python Completions8882
Crystal Completions37
Ruby Completions1105
Elixir Completions312
Haskell Completions307
PHP Completions843
Java Completions2329
TypeScript Completions805
Dart Completions924
CoffeeScript Completions18
Julia Completions57
Swift Completions1314
F# Completions39
C Completions113
COBOL Completions5
Rust Completions229
Total Stars335
% of votes with a positive feedback rating93% of 3065
Total "Very Satisfied" Votes2668
Total "Somewhat Satisfied" Votes350
Total "Not Satisfied" Votes47
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