Implement myAtoi(string s) to transform a string into a signed 32-bit integer.
Process myAtoi(string s) using these steps:
" ") that appear at the beginning of the string.'-' or '+', use it to determine the number's sign.0 when no digits were consumed.[-2^31, 2^31 - 1].Example 1:
Input: s = "58"
Output: 58
Example 2:
Input: s = " +007"
Output: 7
Explanation:
The initial spaces are ignored, the plus sign is processed, and digits are read until the input ends.
Example 3:
Input: s = "2468xyz"
Output: 2468
0 <= s.length <= 200s contains English letters, digits (0-9), spaces (' '), and the symbols ('+', '-', '.').