Recursion and Friends

Given a number n, count minimum steps to minimize it to 1 according to the following criteria:

If n is divisble by 2 then we may reduce n to n/2
If n is divisble by 3 then we may reduce n to n/3
Or decrement n by 1

This Is Where Memoization Comes In

Now to Introduce Tabulation

Jump into the code

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store