Largest int from concatenated ints: Difference between revisions

Content added Content deleted
(→‎{{header|Perl 6}}: prefer string comparison, which won't fail on leading zeros, if there were any, which there aren't)
Line 495: Line 495:
loop il over ints
loop il over ints
say largestInt(il).right(20) ':' il.space(1, ',')
say largestInt(il).right(20) ':' il.space(1, ',')
end il
end il
return
return
</lang>
</lang>
Line 503: Line 503:
6054854654 : 54,546,548,60
6054854654 : 54,546,548,60
</pre>
</pre>

=={{header|OCaml}}==
=={{header|OCaml}}==
<lang ocaml>let myCompare a b = compare (b ^ a) (a ^ b)
<lang ocaml>let myCompare a b = compare (b ^ a) (a ^ b)