Largest int from concatenated ints: Difference between revisions

Content added Content deleted
Line 545: Line 545:
{{works with|Scala|2.9.1}}
{{works with|Scala|2.9.1}}
<lang Scala>object LIFCI extends App {
<lang Scala>object LIFCI extends App {
List(List(1, 34, 3, 98, 9, 76, 45, 4), List(54, 546, 548, 60)).map{l=>l.permutations.toList
.map{l=>(l.map{_.toString}:\"")(_+_).toLong}.sorted.last}.foreach{println}
}</lang>
}</lang>
Output:
Output:
<pre>
<pre>998764543431
</pre>
6054854654</pre>


=={{header|Tcl}}==
=={{header|Tcl}}==