Skip to content

Commit bfe2755

Browse files
committed
feat: fixed bug in Zion's GameResult and Stack Results to lesson_12 hw
1 parent cc3510f commit bfe2755

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public String gameResult(ListNode head) {
1010
ListNode current = head;
1111
int even = 0;
1212
int odd = 0;
13-
while (current.next != null) {
13+
while (current != null) {
1414
ListNode nextNode = current.next;
1515
if (current.val < nextNode.val) {
1616
odd++;
@@ -26,7 +26,6 @@ public String gameResult(ListNode head) {
2626
if (even < odd) {
2727
return "Odd";
2828
}
29-
3029
if (even == odd) {
3130
return "Tie";
3231
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,4 @@ public boolean isEmpty() {
2828
return top == null;
2929
}
3030
}
31+
// I used chatgpt to walk me through the implementation without giving me the answers.

0 commit comments

Comments
 (0)