Plus One Problem
Plus One Problem — ExecCode School DSA Practice
Solve the Plus One problem on ExecCode. Free online school DSA practice in Arrays - Basics. Write and run code in Java, C++, Python — no signup required to run.
Problem description
Given a large integer represented as an array of digits, increment the integer by one. Your task is to solve Plus One. The digits are stored such that the most significant digit is at the beginning of the array.
Examples
Input 3 1 2 3; Output 1 2 4. Input 1 9; Output 1 0
Constraints
1<=N<=10^5
Practice Plus One free on ExecCode. Browse DSA problems, topic map, and placement guides.