• gamma-02commented on "Number of trailing zeros of N!" java solution

(Integer.MAX_VALUE)! is so INCOMPREHENDINGLY huge that we probably won't ever need the number of trailing zeroes lmao

• gamma-02commented on "Number of trailing zeros of N!" java solution

negative factorials don't have a value, mathematically or computationally as far as I know, becaues of the definition

n! = n*((n-1)!), where 0! = 1

this is also the reason for some other funky mathematical phenomona, but this is a CS site so

point is, this function will never be used for values where n is an element of (-∞,0)

• julienstudiocommented on "Number of trailing zeros of N!" java solution

Completely forgot you could multiply i in a for loop, this is the upgraded version of mine

• broutraycommented on "Number of trailing zeros of N!" java solution

what if n is -6?

• xehpukcommented on "Breaking chocolate problem" java solution

An important skill in software engineering is reading the requirements thoroughly.

• JonSwishcommented on "Breaking chocolate problem" java solution

It doesn't filter negative values; if we have -10 and -5 as inputs, this function would return 49.

• sergejjevsejevcommented on "Breaking chocolate problem" java solution

I prefer to filter out by invalid values n,m. Then there is no unneeded multiplication happening

• gt00unitcommented on "Number of trailing zeros of N!" java solution

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

• tyler5673commented on "Number of trailing zeros of N!" java solution

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

• 0leggcommented on "Breaking chocolate problem" java solution

No, but return value is integer anyway, so there is no possible way to return correct value using integer. We can return 0 in this case, because input data will be kind of incorrect, but I don't think it's a good way to solve the task.

• 0leggcommented on "Breaking chocolate problem" java solution

Description says: "Input will always be a non-negative integer.", so we can omit handling this case

• monikapencommented on "Breaking chocolate problem" java solution

What about negative values? For example n = -5, m = -4. I think it should return 0. Your solution will give 19.

• billhorvathcommented on "Breaking chocolate problem" java solution

Will this solution work if `(n * m - 1) > Integer.MAX_VALUE`?

• wowtimcommented on "Breaking chocolate problem" java solution

Nice solutions!!!