Skip to content

Commit a19459f

Browse files
committed
https://leetcode.cn/problems/plus-one-linked-list/
1 parent 6b0ea16 commit a19459f

File tree

4 files changed

+1646
-30
lines changed

4 files changed

+1646
-30
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ leetcode 测试
1010

1111
##### 包含的内容如下
1212

13+
https://leetcode.cn/problems/plus-one-linked-list/
14+
1315
https://leetcode.cn/problems/minimum-swaps-to-make-sequences-increasing/
1416

1517
https://leetcode.cn/problems/6eUYwP/

plus-one-linked-list/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { ListNode } from "../reverse-linked-list/ListNode.ts";
2+
import po from "../plus-one/index.ts";
3+
import { ListNodeToArray } from "../reverse-linked-list/ListNodeToArray.ts";
4+
import { ArrayToListNode } from "../reverse-linked-list/ArrayToListNode.ts";
5+
export default function plusOne(digits: ListNode | null): ListNode | null {
6+
return [digits].map(ListNodeToArray).map(po).map(ArrayToListNode)[0];
7+
}

0 commit comments

Comments
 (0)