7 kyu

Flatten and sort an array

13,091 of 29,882lilsweetcaligula

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 Trained42751
Total Skips3486
Total Code Submissions72926
Total Times Completed29882
JavaScript Completions13091
Python Completions9031
Crystal Completions37
Ruby Completions1110
Elixir Completions314
Haskell Completions311
PHP Completions853
Java Completions2350
TypeScript Completions821
Dart Completions935
CoffeeScript Completions18
Julia Completions58
Swift Completions1328
F# Completions39
C Completions116
COBOL Completions5
Rust Completions244
Total Stars338
% of votes with a positive feedback rating93% of 3077
Total "Very Satisfied" Votes2679
Total "Somewhat Satisfied" Votes351
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