Largest int from concatenated ints: Difference between revisions

Content added Content deleted
(Minor fix)
(Realize in F#)
Line 543: Line 543:
</pre>
</pre>


=={{header|F_Sharp|F#}}==
<lang fsharp>
// Form largest integer which is a permutation from a list of integers. Nigel Galloway: March 21st., 2018
let fN g = List.map (string) g |> List.sortWith(fun n g->if n+g<g+n then 1 else -1) |> System.String.Concat
</lang>
{{out}}
<pre>
fN [1; 34; 3; 98; 9; 76; 45; 4] -> "998764543431"
fN [54; 546; 548; 60] -> "6054854654"
</pre>
=={{header|Fortran}}==
=={{header|Fortran}}==
There is often a potential ambiguity when reading numbers. While three definitely names the Platonic number notion, 3 might instead be regarded as being a text that happens to have the glyph of a number but is not a number. This sort of discussion arises when a spreadsheet has read in a text file and behold! numbers are on the display and they look just like what is displayed when numbers are being shown, but, they are ''not'' numbers, they are only drawn that way. Within the spreadsheet they are parts of some text, and the notion that takes over is one of a "blunt, heavy object", not alas close to hand.
There is often a potential ambiguity when reading numbers. While three definitely names the Platonic number notion, 3 might instead be regarded as being a text that happens to have the glyph of a number but is not a number. This sort of discussion arises when a spreadsheet has read in a text file and behold! numbers are on the display and they look just like what is displayed when numbers are being shown, but, they are ''not'' numbers, they are only drawn that way. Within the spreadsheet they are parts of some text, and the notion that takes over is one of a "blunt, heavy object", not alas close to hand.
Line 645: Line 655:
Biggest:9 8 7 6 5 4 3 2 1 10
Biggest:9 8 7 6 5 4 3 2 1 10
</pre>
</pre>

=={{header|FreeBASIC}}==
=={{header|FreeBASIC}}==
<lang freebasic>' version 17-01-2016
<lang freebasic>' version 17-01-2016