Leetcode – String to Integer (atoi)

Name: String to Integer (atoi)Difficulty: MediumDescription: Convert a string to an integer as per the C++ atoi function Example: Input: s = “42” Output: 42 Input: s = ” -42″ Output: -42 Input: s = “4193 with words” Output: 4193 This is a pretty straight forward solution, I enjoy writing code that parses text.