The input number can be simplified to a value under 162


  • 0
    N
    1. If the number is bigger than 99, digitSquareSum will decrease in value.
    2. If there is a cycle, the maximum number cannot exceed 9^2 + 9^2 = 162
    3. Thus the input number can be reduced to a value under 162 for further investigation.

Log in to reply
 

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