Pergunta de entrevista da empresa Samsung Electronics

I was asked to split integer into digits