Skip to content

Commit 14d00d6

Browse files
author
AmiyahJo
committed
fix: joined lesson12.ts oddPoints and evenPoints together
Merged into one line
1 parent 4a4e6fa commit 14d00d6

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lesson_12/structs_ts/src/lesson12.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ export class Lesson12 {
66
* https://github.com/yang-su2000/Leetcode-algorithm-practice/tree/master/3062-winner-of-the-linked-list-game
77
*/
88
public gameResult(head: ListNode | null): string {
9-
let oddPoints = 0;
10-
let evenPoints = 0;
9+
let [oddPoints, evenPoints] = [0,0];
1110

1211
let current = head;
1312

@@ -17,7 +16,7 @@ export class Lesson12 {
1716
} else if (current.val < current.next.val) {
1817
oddPoints++;
1918
}
20-
// current = current.next.next;
19+
current = current.next;
2120
}
2221

2322
if (oddPoints > evenPoints) {

0 commit comments

Comments
 (0)