Skip to content

Latest commit

 

History

History

sort-the-odd

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
  • Completed at: 2023-10-05T22:15:33.915Z

  • Completed languages: java

  • Tags: Fundamentals, Arrays, Sorting

  • Rank: 6 kyu

Description

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]
### Encodings

purity: `LetRec`  
numEncoding: `BinaryScott`  
export constructors `nil, cons` and deconstructor `foldl` for your `List` encoding