### Persistent Bugger

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.

``````persistence(39) === 3 // because 3*9 = 27, 2*7 = 14, 1*4=4
// and 4 has only one digit

persistence(999) === 4 // because 9*9*9 = 729, 7*2*9 = 126,
// 1*2*6 = 12, and finally 1*2 = 2

persistence(4) === 0 // because 4 is already a one-digit number
``````

• 返回的是连乘的次数，有时候一个很长的数不一定能执行多次，比如254123421。因为2*5=10 出现了0.所以结果是2。
• 考虑到前后数的连续性，可使用JS提供的reduce函数，详见

### Find the divisors!

Create a function named divisors that takes an integer and returns an array with all of the integer’s divisors(except for 1 and the number itself). If the number is prime return the string ‘(integer) is prime’ (use Either String a in Haskell and Result, String> in Rust).

• prime指质数

### Find The Parity Outlier

You are given an array (which will have a length of at least 3, but could be very large) containing integers. The array is either entirely comprised of odd integers or entirely comprised of even integers except for a single integer N. Write a method that takes the array as an argument and returns N.

For example:

[2, 4, 0, 100, 4, 11, 2602, 36] Should return: 11

[160, 3, 1719, 19, 11, 13, -21] Should return: 160

• prime指质数

• 思路