Ad
  • Custom User Avatar

    You don't need to prevent "scientific notation". Scientific notation is just... notation. Why would it matter what kind notation is used? Notation has no impact on calculations (not in this kata, at least).

    What you have to avoid though is overflow. The "scientific notation" you observed is a symptom of the fact that your numbers overflow MAX_INT at some point and turn into imprecise floatign point numbers. Large FP numbers are represented with scientific notation, so what you observe is just a visible symptom of the fact that your calculations overflow and your numbers lose precision. Find a way to get the answer without overflowing, keep calculations precise, and you will be good. *e+20 is not your problem, but 30! is.

  • Custom User Avatar

    Hint: You're not meant to calculate the factorial. Find another way to find the number of zeros.

  • Custom User Avatar

    Not a kata issue.