Ad
  • Custom User Avatar

    Personaly I think this should be a complaint with the question, because it is implied that they will be positive, but the type signature/constraints don't explicitly say so.

  • Custom User Avatar

    Using the mathematical properties of arithmetico-geometric sequences, we can express the problem with a nice equation that we just need to solve.

    This cuts down the computational complexity magnitude to that of log().

    The code is clean, although the rate is useless if percent is 0, and you could have factored aug/(1-rate) into its own variable.

    I like that solution!