Largest int from concatenated ints: Difference between revisions
Content added Content deleted
Alextretyak (talk | contribs) m (→{{header|11l}}) |
|||
Line 2,679: | Line 2,679: | ||
[1 34 3 98 9 76 45 4] => [9 98 76 45 4 34 3 1] (concatenated: 998764543431) |
[1 34 3 98 9 76 45 4] => [9 98 76 45 4 34 3 1] (concatenated: 998764543431) |
||
[54 546 548 60] => [60 548 546 54] (concatenated: 6054854654) |
[54 546 548 60] => [60 548 546 54] (concatenated: 6054854654) |
||
</pre> |
|||
=={{header|Transd}}== |
|||
<syntaxhighlight lang="Scheme">#lang transd |
|||
MainModule: { |
|||
_start: (lambda |
|||
(for ar in [[98, 76, 45, 34, 9, 4, 3, 1], [54, 546, 548, 60]] do |
|||
(sort ar (λ l Int() r Int() (ret (> Int(String(l r)) Int(String(r l)))))) |
|||
(lout (join ar ""))) |
|||
) |
|||
}</syntaxhighlight> |
|||
{{out}} |
|||
<pre> |
|||
998764543431 |
|||
6054854654 |
|||
</pre> |
</pre> |
||