Mental Model
Convert a string of characters into a number by reading each digit one by one and building the number step by step.
Analogy: Like reading a price tag digit by digit and writing down the total amount as you go, ignoring any extra words or symbols before or after the number.
"Input string: ' -42abc'\nRead chars -> skip spaces -> read sign -> read digits -> stop at non-digit\nNumber built: 0 -> 4 -> 42 -> apply sign -> -42"
