Bloomberg Interview Question

write atoi function.