Soal
00:00

7. Plus One

MudahArrayGoogleMicrosoft

A non-negative integer is represented by the array digits. Add one to the integer and return the resulting digits.

Contoh 1:

Input: digits = [1,2,3]
Output: [1,2,4]

Contoh 2:

Input: digits = [9]
Output: [1,0]

Batasan:

  • 1 <= digits.length <= 100
Mode kode inti
● Tersimpan otomatisBaris 1, kolom 1