+ 20
[ASSIGNMENT] Arrange numbers
Input any large number and arrange it digits in ascending order with alternate odd and even number if pair is not possible then print only in ascending Eg. Input 12361 output 12361//alternate odd even ascending input 748291 output 127498 input 111112 output 1211111 input 12111311 output 12111113
18 Answers
+ 18
Good code everyone 👍
+ 15
https://code.sololearn.com/c1ZB6QJy5yo3/?ref=app
is it okay?
+ 8
well well well.
+ 8
+ 7
in ruby:
with random number of 8 digits:
https://code.sololearn.com/ctIjdEt79XM9
with user input and simplified code for length of arrays:
https://code.sololearn.com/cDUa7M852RB5/
+ 7
https://code.sololearn.com/cq5mKYD3xw24/?ref=app
+ 6
https://code.sololearn.com/cT8glPBbAYyb/
My try :) :)
my first code here so I hope you like it (even it is very simple)
+ 6
@karol you can print the output as a number by
for z in final:
print(z,end="")
give it a try☺
+ 5
Great
+ 5
thanks
+ 5
@christof try to input pls
+ 4
@rahul
Thank you... that look much better :)
+ 4
Great efforts
+ 3
Another one in Ruby
https://code.sololearn.com/cJikzU8q61Su/?ref=app
+ 1
https://code.sololearn.com/c63oKOc69SkB/?ref=app
0
I know it's a bit late, but here's mine
https://code.sololearn.com/cP8eFF4EZ9xM/?ref=app