5 kyu

Building a Sequence Cocatenating Digits with a Given Order.

130 of 193raulbc777

Description:

You will receive an uncertain amount of integers in a certain order k1, k2, ..., kn.

You form a new number of n digits in the following way: you take one of the possible digits of the first given number, k1, then the same with the given number k2, repeating the same process up to kn and you concatenate these obtained digits(in the order that were taken) obtaining the new number. As you can see, we have many possibilities.

Let's see the process above explained with three given numbers:

k1 = 23, k2 = 17, k3 = 89
Digits Combinations   Obtained Number
  ('2', '1', '8')           218    <---- Minimum
  ('2', '1', '9')           219
  ('2', '7', '8')           278
  ('2', '7', '9')           279
  ('3', '1', '8')           318
  ('3', '1', '9')           319
  ('3', '7', '8')           378
  ('3', '7', '9')           379    <---- Maximum
             Total Sum =   2388   (8 different values)

We need the function that may work in this way:

proc_seq(23, 17, 89) == [8, 218, 379, 2388]
procSeq(23, 17, 89) ---> [8, 218, 379, 2388]

See this special case and deduce how the function should handle the cases which have many repetitions.

proc_seq(22, 22, 22, 22) == [1, 2222] # we have only one obtained number, the minimum, maximum and total sum coincide
procSeq(22, 22, 22, 22) ---> [1, 2222] /* we have only one obtained number, the minimum, maximum and total sum coincide*/

The sequence of numbers will have numbers of n digits only. Numbers formed by leading zeroes will be discarded.

proc_seq(230, 15, 8) == [4, 218, 358, 1152]
procSeq(230, 15, 8) ---> [4, 218, 358, 1152]

Enjoy it!!

You will never receive the number 0 and all the numbers will be in valid format.

Fundamentals
Data Structures
Algorithms
Mathematics
Logic
Strings

Stats:

CreatedApr 20, 2016
PublishedApr 20, 2016
Warriors Trained708
Total Skips207
Total Code Submissions1417
Total Times Completed193
Python Completions130
JavaScript Completions52
Ruby Completions25
Total Stars28
% of votes with a positive feedback rating94% of 53
Total "Very Satisfied" Votes47
Total "Somewhat Satisfied" Votes6
Total "Not Satisfied" Votes0
Total Rank Assessments8
Average Assessed Rank
5 kyu
Highest Assessed Rank
5 kyu
Lowest Assessed Rank
6 kyu
Ad
Contributors
  • raulbc777 Avatar
  • smile67 Avatar
  • G_kuldeep Avatar
  • Just4FunCoder Avatar
  • saudiGuy Avatar
Ad