8. String to Integer (Atoi)
Input: "42"
Output: 42Input: " -42"
Output: -42
Explanation: The first non-whitespace character is '-', which is the minus sign.
Then take as many numerical digits as possible, which gets 42.Last updated
Was this helpful?