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: import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Main
{
    private static int getNext(int n) {
        int totalSum = 0;
        while (n > 0) {
            int d = n % 10;
            n = n / 10;
            totalSum += d * d;
        }
        return totalSum;
    }

    public static boolean isHappy(int n) {
        Set<Integer> seen = new HashSet<>();
        while (n != 1 && !seen.contains(n)) {
            seen.add(n);
            n = getNext(n);
        }
        return n == 1;
    }
   
	public static void main (String[] args) throws java.lang.Exception
	{
        Scanner inp = new Scanner(System.in);
        int n = inp.nextInt();
        System.out.println(isHappy(n));
    }
}
, In this Programming Language: Java, Now tell me if this Code is compilable or not?