umdreamer / leetcodeproblems

Solutions for LeetCode OJ
3 stars 9 forks source link

2023.5.16 Problem: 66. Plus One #14

Closed umdreamer closed 1 year ago

umdreamer commented 1 year ago
  1. Plus One Problem Link

You are given a large integer represented as an integer array digits, where each digits[i] is the ith digit of the integer. The digits are ordered from most significant to least significant in left-to-right order. The large integer does not contain any leading 0's.

Increment the large integer by one and return the resulting array of digits.

Example 1:

Input: digits = [1,2,3]
Output: [1,2,4]
Explanation: The array represents the integer 123.
Incrementing by one gives 123 + 1 = 124.
Thus, the result should be [1,2,4].

Example 2:

Input: digits = [4,3,2,1]
Output: [4,3,2,2]
Explanation: The array represents the integer 4321.
Incrementing by one gives 4321 + 1 = 4322.
Thus, the result should be [4,3,2,2].

Example 3:

Input: digits = [9]
Output: [1,0]
Explanation: The array represents the integer 9.
Incrementing by one gives 9 + 1 = 10.
Thus, the result should be [1,0].

Constraints:

yeyuxq commented 1 year ago

image

mafanjia commented 1 year ago

截屏5

liu-si-han commented 1 year ago
image
ZWJ2212061008 commented 1 year ago

image

bedauern commented 1 year ago
Snipaste_2023-05-16_18-29-32
shylieisme commented 1 year ago

$5YO)WRYRSVC_78ZA{6TUU7

wangshiqi7 commented 1 year ago
截屏2023-05-16 18 26 23
PinkyLame commented 1 year ago

image

zhjingyan commented 1 year ago

image

Lggg1234 commented 1 year ago

屏幕截图 2023-05-16 191812

123lrb commented 1 year ago

($C%MKC@OGW T9AFS9`G2`B

zxm-1235 commented 1 year ago

image

sjh397 commented 1 year ago

屏幕截图 2023-05-16 175735

huangyumei1 commented 1 year ago

QQ图片20230516202312

promisewith7 commented 1 year ago

image

foxbou commented 1 year ago
image
12baoxingyu-6 commented 1 year ago
image
cuixiao02 commented 1 year ago
截屏2023-05-16 21 07 14
syr2212061031 commented 1 year ago

6V7TTN}HRM{UF`9U(K%)FCC

1125766961 commented 1 year ago

image

xkqwww commented 1 year ago

无标题

naqianqpg commented 1 year ago

Z~L3VM0E)EV$ZNP$~32`E3F

liuhuanyu6 commented 1 year ago

image

686xiaozhang commented 1 year ago

QQ截图20230516211207

tangyexi commented 1 year ago
屏幕截图 2023-05-16 214726
htywan commented 1 year ago

11

24zlx commented 1 year ago

联想截图_20230516215818

xiaolu2002 commented 1 year ago

image

daowuwu commented 1 year ago

V2VV6M1XL)`CRDXY$V``J}5

FXL1006 commented 1 year ago
image
zyhzxy99 commented 1 year ago

S _2VPD{BTB%@ZJDB7~}@@A

zangfushuo commented 1 year ago
截屏2023-05-16 22 51 06
gusuning commented 1 year ago
屏幕截图 2023-05-17 124419