Search
⌘K

Leetcode 8. String to Integer (atoi)

Parse a string into a 32-bit signed integer by skipping leading whitespace, reading an optional '+'/'-' sign and the following contiguous digits (stopping at the first non-digit), and returning 0 if no digits are read; clamp the result to the 32-bit range [-2^31, 2^31−1] on overflow.

Asked at:

Meta


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Early August, 2025

Meta

Senior

Early August, 2025

Meta

Senior

Early June, 2025

Meta

Manager

Comments

Your account is free and you can post anonymously if you choose.