Amazon interview question

Parse a string to an integer