Здравейте, изпитвам затруднения със следната задача:
Strange Order
Write a program that orders a list of numbers in the following way:
-
3,-2,1,0,-1,0,-2,1
→-2,-1,-2,0,0,3,1,1
You need to find out the criteria for yourself by looking at the example. You can also check the example below.
Input
- On the only line of input, you will receive the numbers, separated by a comma.
Output
- Display the list with the mysterious ordering applied removed, separated by a comma.
Constraints
- 1 <= list.length <= 20
Input
3,-12,0,0,13,5,1,0,-2
Output
-12,-2,0,0,0,3,13,5,1
В джъдж гърмят последните тестове, но не мога да разбера защо
Това е кодът ми: let input = [ '3,-12,0,0,13,5,1,0,-2',];let print = this.print || con - Pastebin.com
Надявам се някой да удари едно рамо, че съвсем забих