String to Integer (atoi)Medium

string simulation parsing

Parse a string into a 32-bit signed integer: skip leading spaces, read an optional sign, consume digits until a non-digit, and clamp to [-2^31, 2^31-1]. Watch the scanner advance character by character.

Press play to watch the algorithm run.
Metrics
Legend
How it works
0 / 0