Skip to main content
The National Cipher Challenge

Reply To: Programming

#98187
ByteInBits
Participant

=========================================== PROGRAMMING QUEST #4

PRODUCE THE LARGEST INTERGER FROM A SET OF INTEGERS BY ORDERING AND CONCATENATION

Here is a set and the largest number obtained to check your code against
[2, 34, 7, 98, 9, 77, 41, 5] The 8 integers arrange to : 998777541342

VARIOUS TASKS
Code functions to :
(A) Return a random positive integer having a random count of digits between 1 and 6,
(B) Return a random set of between 5 and 10 integers using the (A) generated integers.
(C) Concatenate the integers in the set (B) in such an order that the largest integer is returned.
(D) Show (print) the integers in the set (B) followed by the largest number (C) produced.
Produce 10 Different Results of (D)

\\ EXAMPLE OUTPUT (will be different for each run)
\\ Set1 [3, 11, 48427, 22944, 6677, 1849, 9, 4] The 8 integers arrange to : 96677484274322944184911
\\ Set2 [58615, 3, 934, 3, 23666] The 5 integers arrange to : 934586153323666
\\ Set3 [88978, 69576, 83499, 31, 27398, 856, 219, 23991] The 8 integers arrange to : 889788568349969576312739823991219
\\ Set4 [3, 7119, 49, 533, 3614, 512, 45, 4711, 4761] The 9 integers arrange to : 711953351249476147114536143
\\ Set5 [3852, 3, 41977, 98, 3488, 22, 1117] The 7 integers arrange to : 9841977385234883221117
\\ Set6 [8335, 17293, 29, 16, 79, 7, 59785, 1, 96358] The 9 integers arrange to : 963588335797597852917293161
\\ Set7 [94, 68252, 8984, 11793, 95] The 5 integers arrange to : 959489846825211793
\\ Set8 [5767, 7, 17279, 3366, 38, 29995, 3, 588, 52179] The 9 integers arrange to : 758857675217938336632999517279
\\ Set9 [68, 6, 4761, 42, 8855, 13, 8432, 3661, 332] The 9 integers arrange to : 88558432686476142366133213
\\ Set10 [4374, 98, 83483, 1, 4249, 3] The 6 integers arrange to : 98834834374424931

Extra non-random sets:
What is the largest integer that can be formed :
1] from a set of the first 50 positive integers in ascending order 1 .. 50
2] from a set of all positive even integers below and including 100 in ascending order
3] from a set of all positive odd integers below and including 99 in ascending order
4] from the first 20 prime numbers in ascending order

Give MD5’s for the 4 non-random large integers.
1] MD5: ?
2] MD5: ?
3] MD5: ?
4] MD5: ?

Report a problem