6 kyu

Persistent Bugger.

72,277 of 208,867joh_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

Stats:

CreatedAug 3, 2015
PublishedAug 3, 2015
Warriors Trained379492
Total Skips52926
Total Code Submissions664528
Total Times Completed208867
JavaScript Completions72277
Clojure Completions447
Ruby Completions5957
Python Completions76162
CoffeeScript Completions80
C# Completions12649
Java Completions20576
Haskell Completions1631
Elixir Completions555
Swift Completions1404
PHP Completions4579
F# Completions183
Kotlin Completions1685
Scala Completions658
C Completions3555
Julia Completions124
Rust Completions1905
Prolog Completions32
Pascal Completions31
COBOL Completions13
C++ Completions3932
TypeScript Completions2439
Crystal Completions19
Go Completions1312
Lua Completions163
Factor Completions10
D Completions12
Dart Completions112
Total Stars4624
% of votes with a positive feedback rating92% of 17640
Total "Very Satisfied" Votes14842
Total "Somewhat Satisfied" Votes2603
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
  • trashy_incel 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