For this Question: Write an algorithm to determine if a number n is happy. A happy number is a number defined by the following process:<ul><li>Starting with any positive integer, replace the number by the sum of the squares of its digits. </li><li>Repeat the process until the number equals 1 (where it will stay), or it loops endlessly in a cycle which does not include 1. </li><li>Those numbers for which this process ends in 1 are happy. </li></ul>Return true if n is a happy number, and false if not.The first line of the input contains the number n.

Constraints
1 <= n <= 2<sup>31</sup>-1Print <b>true</b> if it's a happy number otherwise <b>false</b>.Sample Input 
19

Sample Output 
true

Explanation
1<sup>2</sup> + 9<sup>2</sup> = 82
8 <sup>2</sup> + 2<sup>2</sup> = 68
6<sup>2</sup> + 8<sup>2</sup> = 100
1<sup>2</sup> + 0<sup>2</sup> + 0<sup>2</sup> = 1, I have written this Solution Code: from collections import defaultdict
def sum_int(num):
  tot=0
  while(num!=0):
    tot+=(num%10)**2
    num=num//10
  return tot
n=int(input())
d=defaultdict(int)
while(n!=1 and d[n]==0):
  d[n]+=1
  n=sum_int(n)
if(n==1):
  print("true")
else:
  print("false")
, In this Programming Language: Python, Now tell me if this Code is compilable or not?