Project Euler 31 - Coin sums

Official link: https://projecteuler.net/problem=31

Thought Process

The first way I solved this problem I made an 7 nested loop (we don't need 8 because if we have 1, 2$ coin the we cannot use any other coins) to go through all the possible coins combinations, with restrictions, like for example if we have 1, 1$ coin then we can have 0 to 2, 0.5$ coins, etc, etc. By creating restrictions based off every coin the code can run in ~1.5 seconds.

After I finished problem Problem 76 I came back to this problem and using my partition function, I was able to solve the problem ~0.0005 seconds

Interactive Code

Input an integer (1-200) yourinput for example 145 = 1.45$

Code will output the number of ways to to create yourinput$

I have also included the original code I used