categoryGrokking Coding Interview2 - Fast and slow pointers1 - Happy NumberOn this page1 - Happy NumberProblem StatementApproch 1: Fast and slow pointers approchPythonWritten by @kondekarshubham123def is_happy_number(n): split = lambda num: sum(list(map(lambda x: int(x) ** 2, list(str(num))))) one = n two = split(n) while two != 1 and one != two: one = split(one) two = split(split(two)) return two == 1