Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
When do you truncate?
(balance * interest).floor - (withdraw * inflation).floor ?
((balance * interest) - (withdraw * inflation).floor ?
Or some weird combination?
((balance * interest) - (withdraw * inflation).floor).floor ?
((balance * interest).floor - (withdraw * inflation)).floor ?
I tried solving with memoization so that previously calculated primes can be used for future numbers. Only primes will be used to evaluate if a number is prime. For example, there are only 168 primes from 1-1000. So for every number under 1,000,000 I can just check it with the the 168 precalculated numbers. 84% time savings I thought... Turns out brute forcing calculations is cheaper/faster than saving infomation.
try to use descriptive variable names and avoid a,b,c and x,y,z
Nice clean solution