Largest int from concatenated ints: Difference between revisions

m
(→‎{{header|Kotlin}}: Update Kotlin)
Line 276:
=={{header|Ceylon}}==
{{trans|Kotlin}}
{{works with|Ceylon|1.2.1}}
<lang ceylon>shared void runrun2() {
function intConcatenationComparer(Integer x, Integer y) {
valueassert(exists xy = parseInteger(x.string + y.string) else -1;,
value exists yx = parseInteger(y.string + x.string) else -1);
return yx <=> xy;
}
function biggestConcatenation(Integer* ints) => "".join(ints.sort(intConcatenationComparer));
 
value test1 = {1, 34, 3, 98, 9, 76, 45, 4};
value test2 = {54, 546, 548, 60};
Anonymous user