LTM Limited Interview Question

The asked Amostrong number code in Java