Write an algorithm to determine if a number n is happy.
A happy number is a number defined by the following process:
1 (where it will stay), or it loops endlessly in a cycle which does not include 1.Return true if n is a happy number, and false if not.
1 <= n <= 2^31 - 1n = 19truen = 2false