Skip to content

Commit 996dc0a

Browse files
committed
working through the homeowrk
1 parent 8676acd commit 996dc0a

File tree

1 file changed

+11
-0
lines changed
  • lesson_12/structs_java/structs_app/src/main/java/com/codedifferently/lesson12

1 file changed

+11
-0
lines changed

lesson_12/structs_java/structs_app/src/main/java/com/codedifferently/lesson12/Lesson12.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,17 @@ public class Lesson12 {
77
* https://github.com/yang-su2000/Leetcode-algorithm-practice/tree/master/3062-winner-of-the-linked-list-game
88
*/
99
public String gameResult(ListNode head) {
10+
ListNode current = head;
11+
int evenPoints = 0;
12+
int oddPoints = 0;
13+
while(current.next != null){
14+
if (current.val > current.next.val);
15+
evenPoints++
16+
else if(current.val <current.next.val);
17+
oddPoints++
18+
else
19+
20+
}
1021
return null;
1122
}
1223
}

0 commit comments

Comments
 (0)