Smart Number Hackerrank Solution In Java