題庫
00:00

7. Plus One

簡單陣列GoogleMicrosoft

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

範例 1:

輸入: digits = [1,2,3]
輸出: [1,2,4]

範例 2:

輸入: digits = [9]
輸出: [1,0]

限制條件:

  • 1 <= digits.length <= 100
核心程式碼模式
● 已自動儲存第 1 行,第 1 欄