Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.

Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).

Click here to see the full article post

I think the last line: return a < 2 && res <= Integer.MAX_VALUE ? (int)res : 0; use a < 10 is more understandable then a < 2, since a < 10 means the remaining a has to contains only one digit to meet the algorithm

@isucs a == 1 would make more sense... because a should be completely factorised.

a == 1

a

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.