Skip to content

Commit 90a4c55

Browse files
author
AmiyahJo
committed
feat: adds lesson12.ts snippets
refrenced from .java solution but altered to go with typescripts language
1 parent 17fdee5 commit 90a4c55

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

lesson_12/structs_ts/src/lesson12.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,17 @@ 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-
return '';
9+
const oddPoints = 0;
10+
const evenPoints = 0;
11+
12+
13+
14+
if (oddPoints > evenPoints) {
15+
return "Odd";
16+
} else if (evenPoints > oddPoints) {
17+
return "Even";
18+
} else {
19+
return "Tie";
20+
}
1021
}
1122
}

0 commit comments

Comments
 (0)