Add One to a Digit List
Talk it through out loud with your AI coach.
The problem
- easy
- Pro
A large whole number is stored as a list of its digits, most significant digit first, so one hundred and twenty-nine is the list one, two, nine. Add one to the number and return the new list of digits. Explain your approach and the tricky cases.
What a strong answer covers
- Which end of the list to start from and how the carry travels.
- When the work can stop before reaching the front.
- The case where the result needs an extra digit.
- The cost, and why turning the list into a single number is risky.
Common mistake: Forgetting the all-nines case, so the answer keeps the old length and drops the leading one.
Knowing this is half of it. Saying it clearly out loud is the part the coach helps you practise.
Practise it out loud