6
while (hset.count(n) == 0) {7
// If total is equal to 1 return true.8
if (n == 1) return true;9
// Insert the current number in hset...11
// Initialize the total...13
// Create a while loop...15
// Process to get happy number...16
// We use division and modulus operators to repeatedly take digits off17
// the number until none remain... Then squaring each removed digit and18
// adding them together.19
total += (n % 10) * (n % 10);21
// Each new converted number must not had occurred before...23
// Insert the current number into the set s...24
// Replace the current number with total of the square of its digits.27
// If current number is already in the HashSet, that means we're in a cycle28
// and we should return false..