Skip to content

Commit ae360ec

Browse files
committed
✨ [876]
1 parent 482fc0a commit ae360ec

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

876/my_solution.js

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/**
2+
* Definition for singly-linked list.
3+
* function ListNode(val, next) {
4+
* this.val = (val===undefined ? 0 : val)
5+
* this.next = (next===undefined ? null : next)
6+
* }
7+
*/
8+
/**
9+
* @param {ListNode} head
10+
* @return {ListNode}
11+
*/
12+
const middleNode = (head) => {
13+
let s = 0, f = 0, sHead = head, fHead = head;
14+
while (null !== fHead) {
15+
if (null === fHead.next) return sHead;
16+
sHead = sHead.next;
17+
fHead = fHead.next.next;
18+
if (null === fHead) return sHead;
19+
}
20+
};

876/solution.js

Whitespace-only changes.

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ Batch create:
133133
NOTE: JS IS HERE
134134
-->
135135
```ssh
136-
chapter=412 && mkdir ./$chapter && touch ./$chapter/my_solution.js && touch ./$chapter/solution.js && alias x="node ./$chapter/my_solution.js"
136+
chapter=876 && mkdir ./$chapter && touch ./$chapter/my_solution.js && touch ./$chapter/solution.js && alias x="node ./$chapter/my_solution.js"
137137
```
138138
> then you can use `x` for quick debug.
139139

0 commit comments

Comments
 (0)