Implement atoi which converts a string to a 32-bit signed integer (similar to C/C++ atoi).
[-2^31, 2^31 - 1].Input: "42"
Output: 42
Input: " -42"
Output: -42
Input: "4193 with words"
Output: 4193
Runner reads a single line string from stdin and expects a single integer printed to stdout (e.g. input: -42 → output: -42).
No submissions yet.
Talk about parsing edge-cases, spaces, signs, overflow, and early termination rules.