Ad
  • Custom User Avatar

    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 ?

  • Custom User Avatar

    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.

  • Custom User Avatar

    try to use descriptive variable names and avoid a,b,c and x,y,z

  • Custom User Avatar