+ 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.
10 odpowiedzi
+ 12
My code can Handle number with multiple floating points😉: Really took time.
https://code.sololearn.com/cgTJviWLbKg3/?ref=app
+ 8
@Praveen thanks. 👍
+ 6
Without using arrays
https://code.sololearn.com/coTvuhU2EXZU/?ref=app
+ 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..
+ 2
nice qtn.. i think its possible with % n sort
+ 2
Perl:
print join ".", map { join "", reverse sort split // } split /\./, shift;
+ 1
I shall use arrays
0
I claim victory ! https://code.sololearn.com/cGRrqq4p1cDi/?ref=app