Bloomberg interview question

write atoi function.