Implement the `my_atoi(string s)` function, which converts a string to a 32-bit signed integer.
The algorithm for `my_atoi` is as follows:
1. Whitespace: Ignore any leading whitespace (`" "`).
2. Signedness: Determine the sign by checking if the next character is `'-'` or `'+'`, assuming positivity if neither present.
3. Conversion: Read the integer by skipping leading zeros until a non-digit character is encountered or the end of the string is reached. If no digits were read, then the integer is 0.
4. Rounding: If the integer is out of the 32-bit signed integer range `[-2^31, 2^31 - 1]`, clamp the integer so that it remains in the range.
### Constraints
- `0 <= s.length <= 200`
- `s` consists of English letters (lower-case and upper-case), digits (0-9), `' '`, `'+'`, `'-'`, and `'.'`.
### Input Format
A single line containing the string `s`.
### Output Format
Print the clamped 32-bit integer result.
Sample Cases
Example 1Sample Case
Input: 42
Output: 42
Example 2Sample Case
Input: -042
Output: -42
Example 3Sample Case
Input: 43
Output: 43
Example 4Sample Case
Input: 0
Output: 0
Constraints
Runtime Limit: 2000 ms per test batch
Memory Limit: 256 MB
Standard I/O stream reading
Official submissions are evaluated against hidden test cases on the server to verify time & memory complexity.