6 kyu

Persistent Bugger.

72,002 of 207,904joh_pot

Description:

Write a function, persistence, that takes in a positive parameter num and returns its multiplicative persistence, which is the number of times you must multiply the digits in num until you reach a single digit.

For example (Input --> Output):

39 --> 3 (because 3*9 = 27, 2*7 = 14, 1*4 = 4 and 4 has only one digit, there are 3 multiplications)
999 --> 4 (because 9*9*9 = 729, 7*2*9 = 126, 1*2*6 = 12, and finally 1*2 = 2, there are 4 multiplications)
4 --> 0 (because 4 is already a one-digit number, there is no multiplication)
Fundamentals
Mathematics

More By Author:

Check out these other kata created by joh_pot

Stats:

CreatedAug 3, 2015
PublishedAug 3, 2015
Warriors Trained378048
Total Skips52839
Total Code Submissions662499
Total Times Completed207904
JavaScript Completions72002
Clojure Completions445
Ruby Completions5952
Python Completions75751
CoffeeScript Completions79
C# Completions12615
Java Completions20487
Haskell Completions1629
Elixir Completions554
Swift Completions1396
PHP Completions4567
F# Completions182
Kotlin Completions1681
Scala Completions657
C Completions3532
Julia Completions123
Rust Completions1892
Prolog Completions31
Pascal Completions31
COBOL Completions12
C++ Completions3868
TypeScript Completions2402
Crystal Completions18
Go Completions1296
Lua Completions159
Factor Completions10
D Completions10
Dart Completions100
Total Stars4613
% of votes with a positive feedback rating92% of 17609
Total "Very Satisfied" Votes14814
Total "Somewhat Satisfied" Votes2600
Total "Not Satisfied" Votes195
Ad
Contributors
  • joh_pot Avatar
  • jhoffner Avatar
  • Abbe Avatar
  • g964 Avatar
  • Unnamed Avatar
  • ChristianECooper Avatar
  • donaldsebleung Avatar
  • Chrono79 Avatar
  • kazk Avatar
  • kleidemos Avatar
  • B1ts Avatar
  • misayre Avatar
  • calebkleveter Avatar
  • Voile Avatar
  • rowcased Avatar
  • kdmatrosov Avatar
  • monadius Avatar
  • hobovsky Avatar
  • xavierguihot Avatar
  • stellartux Avatar
  • user8436785 Avatar
  • user8237613 Avatar
  • jhonsmall Avatar
  • el-f Avatar
  • ejini战神 Avatar
  • akar-0 Avatar
  • tri@ Avatar
  • elias123tre Avatar
  • albetnov Avatar
  • fcr-- Avatar
  • KayleighWasTaken Avatar
Ad