+ 7

Challenge:Make the largest possible number out of the given number!

For example: input: 369 output:963 ********************** Example 2: input:487.365 output:874.653 Any language accepted.

28th Nov 2017, 1:41 PM
Drumsticks
Drumsticks - avatar
10 Answers
+ 12
My code can Handle number with multiple floating points😉: Really took time. https://code.sololearn.com/cgTJviWLbKg3/?ref=app
29th Nov 2017, 10:33 PM
Justine Ogaraku
Justine Ogaraku - avatar
+ 8
@Praveen thanks. 👍
30th Nov 2017, 7:24 AM
Justine Ogaraku
Justine Ogaraku - avatar
1st Dec 2017, 11:07 PM
Baptiste E. Prunier
Baptiste E. Prunier - avatar
+ 4
simple idea is that you could get individual digits of the number,store it in an array and sort.when it is a floating point value you have to sort the two parts separately..
29th Nov 2017, 9:12 AM
Drumsticks
Drumsticks - avatar
+ 2
nice qtn.. i think its possible with % n sort
28th Nov 2017, 8:36 PM
Jomon G
+ 2
Perl: print join ".", map { join "", reverse sort split // } split /\./, shift;
2nd Dec 2017, 4:05 PM
Rob Klinkhamer
Rob Klinkhamer - avatar
+ 1
I shall use arrays
1st Dec 2017, 11:35 PM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
1st Dec 2017, 11:38 PM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
2nd Dec 2017, 7:16 AM
VcC
VcC - avatar