Back to problems

Array Plus One with Large-Input Follow-Up

Algorithm · Intuit · Medium

Requirements Implement plus_one(digits), a function that accepts an array of decimal digits encoding a non-negative number. It must increase that number by 1 and return the updated digit array. Key expectations: Interpret the rightmost item in the array as the units digit. Increment that final digit, carrying toward the left whenever necessary. When every digit is 9, return an array with one additional digit. Do not turn the complete digit sequence into a numeric value.…

Checking your access…