Coinbase·Data Scientist·Technical Phone Screen
- You're given an array of digits representing a non-negative integer (most significant digit first). Add one to that integer and return the result as an array. You can't just convert the whole thing to a big integer directly. What's your approach and what are the time and space complexities?
“The basic case is easy, just increment the last element.”