File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed
lesson_12/structs_java/structs_app/src/main/java/com/codedifferently/lesson12 Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ public String gameResult(ListNode head) {
10
10
ListNode current = head ;
11
11
int even = 0 ;
12
12
int odd = 0 ;
13
- while (current . next != null ) {
13
+ while (current != null ) {
14
14
ListNode nextNode = current .next ;
15
15
if (current .val < nextNode .val ) {
16
16
odd ++;
@@ -26,7 +26,6 @@ public String gameResult(ListNode head) {
26
26
if (even < odd ) {
27
27
return "Odd" ;
28
28
}
29
-
30
29
if (even == odd ) {
31
30
return "Tie" ;
32
31
}
Original file line number Diff line number Diff line change @@ -28,3 +28,4 @@ public boolean isEmpty() {
28
28
return top == null ;
29
29
}
30
30
}
31
+ // I used chatgpt to walk me through the implementation without giving me the answers.
You can’t perform that action at this time.
0 commit comments