I use ruby. LeetCode gives an expected answer of integer_break(100) = 2124471432. I think this is clearly wrong because an obvious alternative 10**10 = 10,000,000,000 is greater than the expected answer.
Good catch. I think the expected answer is clearly wrong in this case, but it might be because of integer overflow. The function needs to return an integer value and in the case of many languages like Java and C++, an 'integer' value can only range from -2,147,483,648 to 2,147,483,647. You can run into problems like this when you try to fit big numbers into small containers.
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.