Skip to content

Latest commit

 

History

History
12 lines (10 loc) · 359 Bytes

File metadata and controls

12 lines (10 loc) · 359 Bytes

MultipleNumber-Codefights 11/07/2016

Solution for the next Challenge:

Your task is to implement the following algorithm for the given n:

  • let x equal the product of digits in n
  • n =
  • x if n >= 10, goto 1
  • return n.

Example For n = "1234" the output should be MultipleNumber(n) = 8. 1 * 2 * 3 * 4 = 24 and 2 * 4 = 8 thus the answer is 8.