← Back to challenges

Split 25 (Part 1)

JavaScriptHardalgebramathnumberscontrol_flow

Instructions

About a month ago I stumbled upon an interesting problem — something called the 25 split. In the problem, you had to break up 25 into parts, and, from those parts that add to it, try to create the biggest product.

For example, 3 * 22 = 66 or 5 * 5 * 5 * 5 * 5 = 3125. With this first part, return the value of the biggest product possible using natural number parts from a given number, x.

Examples

split(5) ➞ 6
// 3 times 2

split(10) ➞ 36
// 3 * 3 * 4

split(1) ➞ 1

Notes

3's are useful...

javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.