Plus One

Easy
Arrays Array Math

Given a number represented as array of digits, add one. Return the result as space-separated digits.

Constraints

1 ≤ digits.length ≤ 100

Examples

Example 1:
Input: 1 2 3
Output: 1 2 4
Example 2:
Input: 9 9 9
Output: 1 0 0 0
▲ Console

Install Talent Arabia

Get instant access to jobs and career tools on your device.