String to Integer

Exercise from LeetCode, it is accepted