CodeMentor
.
Ask AI
Problems
Learn
C++
TCS
Core CS
HR
Progress
Search
Ctrl
K
0
Lv 1
Problems
Arrays
Plus One
Easy
LeetCode
4/14
00:00
Hint
Run
Ctrl
↵
Submit
Description
Lesson
Code walk
Solution
Easy
Arrays
LeetCode #66
Plus One on a digit array
Handle carry from the right. If all 9s, grow the array.
Examples
Example 1
Input
3 1 2 3
Output
1 2 4
Example 2
Input
3 9 9 9
Output
1 0 0 0
Stuck? Take a nudge
Reveal hint 1 of 3
C++17
Autosaves
Reset
Console
Run your code to see results