Https://leetcode.com/problems/happy-number/
Hey @nmaurya760
U are stuck in infinite loop because when answer is false there exist a cycle
Here I made necessary changes in ur code :https://ide.codingblocks.com/s/347884 
Hey @nmaurya760
U are stuck in infinite loop because when answer is false there exist a cycle
Here I made necessary changes in ur code :https://ide.codingblocks.com/s/347884 