Skip to content

Instantly share code, notes, and snippets.

@dscataglini
Created February 3, 2022 16:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dscataglini/03bdf2d5f3e30a6cabed1ab07c053242 to your computer and use it in GitHub Desktop.
Save dscataglini/03bdf2d5f3e30a6cabed1ab07c053242 to your computer and use it in GitHub Desktop.
Task
You will be given an array of numbers. You have to sort the odd numbers in ascending order while leaving the even numbers at their original positions.
Examples
[7, 1] => [1, 7]
[5, 8, 6, 3, 4] => [3, 8, 6, 5, 4]
[9, 8, 7, 6, 5, 4, 3, 2, 1, 0] => [1, 8, 3, 6, 5, 4, 7, 2, 9, 0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment