Numbers And Strings Easy

+50 PTS

Before you start the test, check out our tutorial challenge

  • TYPE CODE PRACTICE CHALLENGE
  • LANGUAGES JAVASCRIPT, PHP, PYTHON, PYTHON2 AND 2 MORE
    LANGUAGES JAVASCRIPT, PHP, PYTHON, PYTHON2, RUBY, TYPESCRIPT
  • TIME ~10MIN

Numbers And Strings

Challenge outline

Hello and welcome to the challenge!


Write a code which sorts the given array containing numbers and strings. Numbers should be placed first, sorted ascending, and next followed by strings, sorted alphabetically. All values should maintain their type. Also note that numbers written as strings are strings and should be treated as them.


Input

  • an array to sort containing numbers and strings


Output

  • the input array sorted properly

Constraints

  • 0 < array size < 1000
  • 0 < max number value < 1000
  • 0 < max string length < 1000


You can solve this programming contest in Ruby, JavaScript, Python and many other languages. If you want, you can also take part in other September 2019 competitions. Below you can find some of them:



Have fun and good luck! :)