Implement the myAtoi(string s) function, which converts a string to a 32-bit signed integer.
Key rules:
- Whitespace: Ignore leading whitespace.
- Signedness: Determine if the result is positive or negative based on '-' or '+'.
- Conversion: Read characters until a non-digit character is encountered.
- Rounding: If the integer is out of the 32-bit signed integer range, clamp it to INT_MIN or INT_MAX.
- A string
s.
Input: s = " -42"
Output: -42