Largest int from concatenated ints: Difference between revisions
Content deleted Content added
Nimrod -> Nim |
|||
Line 727: | Line 727: | ||
# icsort [54;546;548;60];; |
# icsort [54;546;548;60];; |
||
- : string = "6054854654" |
- : string = "6054854654" |
||
</pre> |
|||
=={{header|Oforth}}== |
|||
<lang Oforth>func: largestInt { map(#asString) sortWith(#>) sum }</lang> |
|||
{{out}} |
|||
<pre> |
|||
>largestInt([1, 34, 3, 98, 9, 76, 45, 4]) println |
|||
989764543431 |
|||
ok |
|||
>largestInt([54, 546, 548, 60]) println |
|||
6054854654 |
|||
</pre> |
</pre> |
||