Ad
  • Default User Avatar

    A float probably isn't the best choice of variable type. And if you actually calculate factorial(n), you are likely to overflow a small-sized integer.

    Hint: You don't have to actually calculate factorial(n). Try shuffling the formula around.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    You should provide the input for that test to check if there is a problem or not.

  • Custom User Avatar

    My Code passes the basic tests and the random tests. Upon attempting, one of the basic tests seem to fail (expeted: 15, actual: -1). When i switch back to testing, all basic tests pass. Has someone experienced this as well?

  • Custom User Avatar

    Could you explain why it is not “clean code“? :)

  • Default User Avatar

    emmmm, sorry ....o_o

  • Custom User Avatar

    TypeScript:

    The code passes all basic tests upon “testing“. Once attempting, the basic test fails because of an undefined entry in the returned array, while the random tests all pass.

    Any hints?