7 kyu

Double Sort

2,592 of 5,091PG1

Description:

Simple enough this one - you will be given an array. The values in the array will either be numbers or strings, or a mix of both. You will not get an empty array, nor a sparse one.

Your job is to return a single array that has first the numbers sorted in ascending order, followed by the strings sorted in alphabetic order. The values must maintain their original type.

Note that numbers written as strings are strings and must be sorted with the other strings.

Fundamentals
Strings
Arrays
Sorting

More By Author:

Check out these other kata created by PG1

Stats:

CreatedSep 4, 2016
PublishedSep 4, 2016
Warriors Trained8331
Total Skips256
Total Code Submissions17712
Total Times Completed5091
JavaScript Completions2592
Python Completions1617
Ruby Completions161
Java Completions523
Kotlin Completions304
Total Stars89
% of votes with a positive feedback rating92% of 948
Total "Very Satisfied" Votes820
Total "Somewhat Satisfied" Votes104
Total "Not Satisfied" Votes21
Total Rank Assessments23
Average Assessed Rank
6 kyu
Highest Assessed Rank
5 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • PG1 Avatar
  • Javatlacati Avatar
  • Blind4Basics Avatar
  • KenKamau Avatar
  • user8436785 Avatar
  • ejini战神 Avatar
Ad