We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4a4e6fa commit 14d00d6Copy full SHA for 14d00d6
lesson_12/structs_ts/src/lesson12.ts
@@ -6,8 +6,7 @@ export class Lesson12 {
6
* https://github.com/yang-su2000/Leetcode-algorithm-practice/tree/master/3062-winner-of-the-linked-list-game
7
*/
8
public gameResult(head: ListNode | null): string {
9
- let oddPoints = 0;
10
- let evenPoints = 0;
+ let [oddPoints, evenPoints] = [0,0];
11
12
let current = head;
13
@@ -17,7 +16,7 @@ export class Lesson12 {
17
16
} else if (current.val < current.next.val) {
18
oddPoints++;
19
}
20
- // current = current.next.next;
+ current = current.next;
21
22
23
if (oddPoints > evenPoints) {
0 commit comments