7 kyu

Sort with a sorting array

1,414 of 1,502madmed88

Description:

Sort an array according to the indices in another array.
It is guaranteed that the two arrays have the same size, and that the sorting array has all the required indices.

    sort(['x', 'y', 'z'], [1, 2, 0]) => ['z', 'x', 'y']
    
    sort(['z', 'x', 'y'], [0, 2, 1]) => ['z', 'y', 'x']
Arrays
Fundamentals
Sorting

More By Author:

Check out these other kata created by madmed88

Stats:

CreatedOct 10, 2017
PublishedOct 10, 2017
Warriors Trained3053
Total Skips51
Total Code Submissions6589
Total Times Completed1502
JavaScript Completions1414
Haskell Completions97
COBOL Completions5
Total Stars36
% of votes with a positive feedback rating89% of 287
Total "Very Satisfied" Votes236
Total "Somewhat Satisfied" Votes37
Total "Not Satisfied" Votes14
Total Rank Assessments18
Average Assessed Rank
6 kyu
Highest Assessed Rank
5 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • madmed88 Avatar
  • Chrono79 Avatar
  • JohanWiltink Avatar
  • Voile Avatar
  • Madjosz Avatar
  • user8436785 Avatar
  • akar-0 Avatar
Ad