Categories

## [Coderbyte] – Multiplicative Persistence [Easy]

In this post, we are going to solve a challenge from Coderbyte called Multiplicative Persistence. The challenge is as follows: Have the function MultiplicativePersistence(num) take the num parameter being passed which will always be a positive integer and return its multiplicative persistence which is the number of times you must multiply the digits in num until you reach a single digit. […]

Categories

## [Coderbyte] – Mean Mode [Easy]

Let’s get back to Coderbyte again. This time we have the “Mean Mode” challenge. The challenge requirements are as follows: Have the function MeanMode(arr) take the array of numbers stored in arr and return 1 if the mode equals the mean, 0 if they don’t equal each other (ie. [5, 3, 3, 3, 1] should return 1 because the mode (3) equals the mean (3)). The array will not […]

Categories

## [Coderbyte] – Dash Insert [Easy]

This problem asks us to add a dash between each pair of odd numbers in the given string. A more detailed description from Coderbyte: Have the function DashInsert(str) insert dashes (‘-‘) between each two odd numbers in str. For example: if str is 454793 the output should be 4547-9-3. Don’t count zero as an odd number.  The first step is to create a […]

Categories

## [Coderbyte] – Powers of Two [Easy]

The challenge description, as it is on Coderbyte: Have the function PowersofTwo(num) take the num parameter being passed which will be an integer and return the string true if it’s a power of two. If it’s not return the string false. For example if the input is 16 then your program should return the string true but if the input is 22 […]