Largest int from concatenated ints: Difference between revisions

m
(Rename Perl 6 -> Raku, alphabetize, minor clean-up)
Line 380:
=={{header|Ceylon}}==
{{trans|Kotlin}}
{{works with|Ceylon|1.23.13}}
<lang ceylon>shared void run2run() {
function intConcatenationComparercomparator(Integer x, Integer y) {
assert (existsis Integer xy = parseIntegerInteger.parse(x.string + y.string),
existsis Integer yx = parseIntegerInteger.parse(y.string + x.string));
return yx <=> xy;
}
function biggestConcatenation({Integer*} ints) => "".join(ints.sort(intConcatenationComparercomparator));
value test1 = {1, 34, 3, 98, 9, 76, 45, 4};
print("``biggestConcatenation(*test1)`` and ``biggestConcatenation(*test2)``");
value test2 = {54, 546, 548, 60};
value test2 = {54, 546, 548, 60};
print("``biggestConcatenation(*test1)`` and ``biggestConcatenation(*test2)``");
print(biggestConcatenation(test2));
}</lang>
 
Anonymous user