Pregunta de entrevista de Microsoft

Write a function that takes in a string and convert it into integer