Python Solution Question - why does it expect 'True' at 'n == 7' ?
class Solution:
    def isHappy(self, n: int) -> bool:
        if n == 1:
            return True
        if n == 7:
            return True
        while n >= 10:
            x = [int(num)*int(num) for num in str(n)]
            n = sum(x)            
            if n == 1:
                return True
            if n == 7:
                return True  
            if n < 10:
                return False
        return False
Comments (1)