Samsung Electronics interview question

I was asked to split integer into digits