leetcode 2020-09-10 04:50

Talk is cheap show me the code.

No. Problems Difficulty
1 Two Sum Easy
2 Add Two Numbers Medium
3 Longest Substring Without Repeating Characters Medium
4 Median of Two Sorted Arrays Hard
5 Longest Palindromic Substring Medium
6 ZigZag Conversion Medium
7 Reverse Integer Easy
8 String to Integer (atoi) Medium
9 Palindrome Number Easy
11 Container With Most Water Medium
12 Integer to Roman Medium
13 Roman to Integer Easy
14 Longest Common Prefix Easy
15 3Sum Medium
16 3Sum Closest Medium
17 Letter Combinations of a Phone Number Medium
18 4Sum Medium
19 Remove Nth Node From End of List Medium
20 Valid Parentheses Easy
21 Merge Two Sorted Lists Easy
22 Generate Parentheses Medium
23 Merge k Sorted Lists Hard
24 Swap Nodes in Pairs Medium
25 Reverse Nodes in k-Group Hard
26 Remove Duplicates from Sorted Array Easy
27 Remove Element Easy
28 Implement strStr() Easy
31 Next Permutation Medium
33 Search in Rotated Sorted Array Medium
34 Find First and Last Position of Element in Sorted Array Medium
35 Search Insert Position Easy
38 Count and Say Medium
39 Combination Sum Medium
40 Combination Sum II Medium
41 First Missing Positive Hard
42 Trapping Rain Water Hard
46 Permutations Medium
48 Rotate Image Medium
53 Maximum Subarray Easy
54 Spiral Matrix Medium
55 Jump Game Medium
56 Merge Intervals Medium
58 Length of Last Word Easy
59 Spiral Matrix II Medium
61 Rotate List Medium
62 Unique Paths Medium
63 Unique Paths II Medium
64 Minimum Path Sum Medium
66 Plus One Easy
67 Add Binary Easy
69 Sqrt(x) Easy
70 Climbing Stairs Easy
74 Search a 2D Matrix Medium
75 Sort Colors Medium
78 Subsets Medium
82 Remove Duplicates from Sorted List II Medium
83 Remove Duplicates from Sorted List Easy
86 Partition List Medium
88 Merge Sorted Array Easy
92 Reverse Linked List II Medium
93 Restore IP Addresses Medium
94 Binary Tree Inorder Traversal Medium
96 Unique Binary Search Trees Medium
98 Validate Binary Search Tree Medium
100 Same Tree Easy
101 Symmetric Tree Easy
102 Binary Tree Level Order Traversal Medium
103 Binary Tree Zigzag Level Order Traversal Medium
104 Maximum Depth of Binary Tree Easy
109 Convert Sorted List to Binary Search Tree Medium
111 Minimum Depth of Binary Tree Medium
112 Path Sum Easy
114 Flatten Binary Tree to Linked List Medium
118 Pascal's Triangle Easy
121 Best Time to Buy and Sell Stock Easy
122 Best Time to Buy and Sell Stock II Easy
125 Valid Palindrome Easy
129 Sum Root to Leaf Numbers Medium
136 Single Number Easy
138 Copy List with Random Pointer Medium
141 Linked List Cycle Easy
142 Linked List Cycle II Medium
143 Reorder List Medium
144 Binary Tree Preorder Traversal Easy
147 Insertion Sort List Medium
148 Sort List Medium
155 Min Stack Easy
160 Intersection of Two Linked Lists Easy
166 Fraction to Recurring Decimal Medium
169 Majority Element Easy
198 House Robber Medium
200 Number of Islands Medium
203 Remove Linked List Elements Easy
206 Reverse Linked List Easy
215 Kth Largest Element in an Array Medium
225 Implement Stack using Queues Easy
226 Invert Binary Tree Easy
230 Kth Smallest Element in a BST Medium
234 Palindrome Linked List Easy
237 Delete Node in a Linked List Easy
242 Valid Anagram Easy
257 Binary Tree Paths Easy
283 Move Zeroes Easy
284 Peeking Iterator Medium
300 Longest Increasing Subsequences Medium
322 Coin Change Medium
328 Odd Even Linked List Medium
344 Reverse String Easy
392 Is Subsequence Easy
414 Third Maximum Number Easy
430 Flatten a Multilevel Doubly Linked List Medium
434 Number of Segments in a String Easy
445 Add Two Numbers II Medium
450 Delete Node in a BST Medium
482 License Key Formatting Easy
707 Design Linked List Medium
725 Split Linked List in Parts Medium
817 Linked List Components Medium
876 Middle of the Linked List Easy
1019 Next Greater Node In Linked List Medium
1171 Remove Zero Sum Consecutive Nodes from Linked List Medium
1290 Convert Binary Number in a Linked List to Integer Easy
1367 Linked List in Binary Tree Medium
Offer 03 Find Repeat Number Easy
Offer 04 Find Number In 2D Array Easy
Offer 05 Replace Space Easy
Offer 06 Reverse Print Easy
Offer 10-I Fib Easy
Offer 13 Moving Count Medium
Offer 22 Get Kth From End Easy
Offer 24 Reverse List Easy
Offer 40 Get Least Numbers Easy
Offer 57-II Find Continuous Sequence Easy
Offer 58-II Reverse Left Words Easy

TODO list

No.
59
199
面试题 01.01
120
91
189
剑指 Offer 11
876
739
41
51
175
剑指 Offer 21
349
剑指 Offer 09
剑指 Offer 29
153
145
18
994
110
347
45
151
217
剑指 Offer 07
213
47
80
剑指 Offer 18
剑指 Offer 46
剑指 Offer 53 - II
338
16
202
105
409
79
146
107
剑指 Offer 64
236
剑指 Offer 42
50
509
40
剑指 Offer 27
605
239
394
32
93
49
203
面试题 17.16
1103
350
面试题 01.06
232
543
剑指 Offer 55 - I
114
10
剑指 Offer 14- I
287
96
771
剑指 Offer 10- II
191
209
1480
90
1365
148
108
113
1431
剑指 Offer 59 - I
455
72
剑指 Offer 53 - I
119
76
746
617
387
84
557
695
152
290
剑指 Offer 59 - II
77
剑指 Offer 17
43
130
547
86
129
404
剑指 Offer 25
139
剑指 Offer 54
面试题 01.02
328
剑指 Offer 15
448
150
415
116
36
1013
1047
832
剑指 Offer 26
237
461
面试题 01.07
268
1143
143
1160
81
128
665
389
124
216
176
257
503
343
面试题 02.02
179
剑指 Offer 56 - I
剑指 Offer 12
剑指 Offer 32 - II
485
剑指 Offer 28
剑指 Offer 32 - III
剑指 Offer 39
60
1046
763
912
977
208
445
57
235
844
279
134
496
567
剑指 Offer 50
221
463
1122
73
1207
697
154
剑指 Offer 48
337
922
647
416
289
219
993
724
205
263
剑指 Offer 38
剑指 Offer 58 - I
207
222
剑指 Offer 61
剑指 Offer 55 - II
231
剑指 Offer 47
29
剑指 Offer 32 - I
剑指 Offer 63
剑指 Offer 33
938
238
106
37
303
680
309
867
131
1052
190
剑指 Offer 31
538
剑指 Offer 52
147
1512
剑指 Offer 51
71
560
628
1470
896
437
633
376
872
230
452
123
137
406
860
剑指 Offer 36
剑指 Offer 34
面试题 01.04
435
剑指 Offer 20
674
892
692
897
剑指 Offer 62
1071
925
561
345
204
1486
704
1004
135
1108
836
1290
剑指 Offer 57
227
783
剑指 Offer 30
109
297
117
剑指 Offer 45
1021
766
面试题 02.03
494
572
面试题 02.01
781
1025
1221
剑指 Offer 16
剑指 Offer 35
1342
914
115
1281
1295
941
LCP 01
224
LCP 06
1006
973
178
657
228
173
面试题 17.10
85
978
1208
459
820
181
240
438
127
830
999
258
188
1370
184
剑指 Offer 56 - II
面试题 16.11
210
530
989
520
637
1002
剑指 Offer 68 - II
738
剑指 Offer 68 - I
171
905
162
643
684
945
1011
138
264
845
52
95
714
402
185
690
542
面试题 17.21
378
304
703
451
1313
841
1351
1310
1114
172
654
1423
367
278
168
718
182
331
383
589
1319
1356
292
30
566
767
399
1162
44
501
1128
354
450
341
183
面试题 01.05
365
559
709
1720
554
99
133
剑指 Offer 60
701
164
316
976
1389
1438
315
581
990
97
面试题 02.05
面试题 04.03
682
696
1248
剑指 Offer 67
377
面试题 02.06
1266
1323
1603
983
1030
513
197
529
888
621
140
165
740
541
861
180
403
454
456
1137
424
面试题 01.08
剑指 Offer 43
1115
368
剑指 Offer 49
132
1672
765
1028
177
面试题 08.01
面试题 08.03
401
面试题 08.05
1299
329
1232
剑指 Offer 14- II
476
1111
剑指 Offer 66
705
917
1482
645
剑指 Offer 65
面试题 01.03
441
480
89
395
220
700
429
面试题 17.04
500
355
342
590
733
1738
443
1095
518
1442
498
1018
174
785
1734
260
474
1588
516
804
1024
剑指 Offer 44
486
747
面试题 04.02
面试题 17.14
1014
460
剑指 Offer 19
784
1304
剑指 Offer 37
551
1518
1300
面试题 16.01
671
717
剑指 Offer 41
442
575
622
706
面试题 04.04
974
752
1051
212
65
1403
1436
491
面试题 01.09
413
965
1005
面试题 16.17
515
852
1441
778
859
1464
1450
1528
1116
947
312
601
262
357
495
707
721
面试题 16.19
1269
1217
326
196
842
997
1035
412
295
744
面试题 02.04
374
540
814
面试题 08.11
653
面试题 16.18
649
1584
面试题 03.04
面试题 02.07
959
1579
299
524
968
1094
1572
626
1631
887
821
87
201
1684
332
1189
1252
面试题 08.09
214
1202
126
523
1460
面试题 08.04
371
725
1038
627
面试题 04.05
728
430
650
421
1249
1544
504
253
1550
面试题 08.07
468
620
839
1491
961
211
563
921
946
1309
1502
933
992
1089
1337
1371
68
410
875
229
面试题 08.12
274
995
面试题 17.13
606
面试题 03.02
532
493
面试题 16.07
417
453
1302
面试题 17.12
669
679
685
659
743
693
877
1678
面试题 02.08
149
1394
1614
1184
334
596
1195
405
687
1641
1662
837
1260
1010
1022
面试题 16.03
1306
1315
670
1019
1117
1346
1576
632
241
648
1380
779
514
819
1109
1190
面试题 08.06
面试题 17.11
662
796
824
521
599
594
LCP 17
面试题 10.05
306
673
884
1200
面试题 04.12
187
1688
面试题 04.10
223
506
863
720
929
1367
1374
LCP 02
321
233
363
1170
1343
677
868
面试题 16.25
595
641
1282
1154
1277
LCP 19
327
934
1287
1305
面试题 17.07
475
904
1239
1539
面试题 08.08
856
1395
1578
1009
面试题 04.06
1391
面试题 04.01
301
507
307
658
1640
874
1008
1091
1185
1446
LCP 18
319
901
面试题 05.03
面试题 05.06
735
1413
556
1178
1408
1475
386
面试题 16.15
336
652
1254
310
583
640
661
807
980
1331
1361
433
797
面试题 10.03
466
678
787
面试题 08.10
380
1385
面试题 10.02
686
942
791
958
1723
1455
LCP 22
面试题 16.16
381
1417
985
698
811
1422
1535
面试题 16.26
788
849
1104
1262
1317
LCP 03
508
1110
1669
1768
313
1375
1456
1624
1732
面试题 08.02
400
1029
1473
969
面试题 05.07
1078
1415
1748
面试题 16.06
373
1003
1773
1079
1689
192
384
908
159
623
944
1033
面试题 16.02
面试题 17.19
931
1179
面试题 16.10
881
1219
1275
面试题 17.17
275
598
951
1026
218
537
986
1325
1704
748
817
870
1402
1673
1822
987
1523
1534
LCP 07
面试题 17.01
492
1382
1387
1437
面试题 03.06
面试题 16.21
324
330
1161
1209
1716
447
539
1496
1710
1042
1291
1419
1636
面试题 04.08
273
550
646
1513
397
473
953
1171
1203
1329
1652
1379
面试题 10.09
面试题 16.20
256
526
1227
1372
1530
1832
1376
1399
1451
1769
1824
726
827
1119
1139
1288
1404
面试题 03.05
340
1144
1414
1556
1598
面试题 16.04
1267
1381
面试题 05.01
1049
1314
1353
1658
419
806
569
1608
1700
1736
面试题 16.24
面试题 17.22
773
1443
712
1247
1332
1360
1366
1481
面试题 03.01
193
1023
1411
1561
470
957
1138
1551
1812
286
611
655
950
967
984
195
318
525
1268
1377
1489
576
802
889
1409
1504
1529
252
512
834
1312
1405
1493
LCP 28
423
1373
1392
1457
1721
762
803
970
1081
1237
1386
713
979
1226
582
769
815
1339
1790
534
565
862
1396
1800
323
393
457
1424
1514
1663
270
346
396
436
546
1448
1466
407
1519
1725
面试题 05.04
949
1507
1553
1839
1106
1296
1410
1694
1753
1805
面试题 17.09
449
890
1124
1222
1293
1566
937
1390
163
372
1020
1338
1552
1165
1213
1344
1462
1695
1834
276
366
462
865
918
1592
1742
440
667
1476
面试题 16.05
面试题 17.08
398
638
894
962
1726
1833
369
593
998
1129
1324
1328
1816
375
579
840
1027
1048
1333
1567
1722
1818
382
426
907
991
1582
1619
1711
1802
838
871
930
1037
1347
1609
1668
1705
面试题 03.03
846
853
1155
1218
1472
1630
1758
1801
LCP 09
636
915
1345
1679
1780
面试题 17.18
477
772
1186
1233
1418
面试题 17.15
261
265
467
574
578
1175
1318
1358
1497
1690
1696
1737
1792
676
886
926
1525
1664
1770
面试题 04.09
186
522
570
1054
1235
1545
1752
1849
156
351
592
1041
面试题 17.24
826
954
1145
1363
1642
464
511
1100
1163
1261
1432
1743
LCP 08
LCP 29
面试题 17.06
988
1349
1471
1616
1827
面试题 05.02
688
883
893
948
1487
1488
1706
1864
971
1053
1123
1130
1276
1340
1433
1594
325
535
603
794
873
1326
388
848
1084
1191
1292
1458
1647
829
1098
1212
1537
1712
1759
390
760
924
1045
1298
1452
1774
1793
LCP 13
161
246
249
502
609
792
1097
1140
1593
1817
面试题 17.23
481
1083
1177
1251
1477
1541
1784
LCP 12
269
1297
1368
1524
1562
1796
285
585
608
812
866
1034
1283
1286
1383
1400
1401
1648
1775
1786
1838
247
266
809
919
996
1234
1560
1727
1754
825
1043
1082
1540
1791
1854
1855
571
754
1311
1406
1577
1807
243
385
1077
1334
1557
1626
1863
607
1099
1201
1350
1744
1829
314
586
795
869
1107
1264
1536
1814
面试题 08.13
348
432
553
564
602
1016
1126
1206
1303
1806
面试题 17.05
487
545
801
923
1076
1169
1253
1461
1503
1656
1665
259
552
666
902
1007
1112
1629
1646
1823
293
333
775
813
935
1086
1150
1156
1505
1653
1856
1859
面试题 10.11
277
408
528
531
615
768
1270
1574
170
577
613
729
1074
LCP 30
352
619
880
932
1173
1362
1465
1546
1685
1749
1760
1765
298
490
597
639
833
1055
1085
1204
1238
1354
1425
1520
1547
1558
1657
1670
1680
1750
1844
面试题 08.14
157
267
580
702
719
722
1064
1164
1214
1225
1321
1600
1745
1763
758
1075
1080
1090
1159
1205
1220
1289
1294
1483
1492
194
472
854
1147
1359
1447
1615
694
831
851
1012
1031
1065
1188
1352
1454
1469
1498
LCP 11
面试题 10.10
250
272
488
610
895
910
916
1102
1224
1509
1563
1828
LCP 33
面试题 17.20
251
716
756
1044
1180
1265
1599
1625
1691
1813
面试题 05.08
379
439
505
630
664
681
793
885
1135
1444
1510
1559
1702
1779
254
280
361
600
1070
1463
1701
317
668
878
911
927
1105
1141
1193
1284
1449
1583
282
635
651
1039
1056
1146
1301
1364
1398
1407
1515
1835
1837
面试题 16.08
面试题 16.14
358
360
689
737
816
847
1127
1198
1211
1223
1241
1320
1378
1604
1781
1848
1865
158
339
777
1245
1280
1322
1412
1605
1649
1785
612
879
1194
1197
1255
1307
1573
1611
1637
1739