Carry the One
A medium Python interview practice problem on DataDriven. Write and execute real python code with instant grading.
- Domain
- Python
- Difficulty
- medium
- Seniority
- mid
Problem
We store counters too big for 64 bits as arrays of base-1,000,000,000 limbs, least significant limb first. Subtracting `b` from `a` (with `a` never smaller than `b`) the way you would on paper, some columns force a borrow from the next limb up. Return the limb indices where a borrow is taken, lowest first.
Summary
In grade-school subtraction you scribble a mark each time you borrow. Recover those marks.
Practice This Problem
Solve this Python problem with real code execution. DataDriven runs your Python code in a real environment and grades it automatically.