6 kyu

Persistent Bugger.

20,707 of 210,608joh_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 Trained381922
Total Skips53111
Total Code Submissions668164
Total Times Completed210608
JavaScript Completions72772
Clojure Completions451
Ruby Completions5973
Python Completions76878
CoffeeScript Completions80
C# Completions12735
Java Completions20707
Haskell Completions1635
Elixir Completions558
Swift Completions1414
PHP Completions4608
F# Completions184
Kotlin Completions1707
Scala Completions661
C Completions3579
Julia Completions124
Rust Completions1935
Prolog Completions32
Pascal Completions31
COBOL Completions13
C++ Completions4050
TypeScript Completions2514
Crystal Completions19
Go Completions1344
Lua Completions167
Factor Completions10
D Completions12
Dart Completions133
OCaml Completions5
Total Stars4653
% of votes with a positive feedback rating92% of 17708
Total "Very Satisfied" Votes14897
Total "Somewhat Satisfied" Votes2613
Total "Not Satisfied" Votes198
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