Skip to content

Commit f9978d8

Browse files
author
Yafiaha
committed
Fix-up
1 parent e9c5deb commit f9978d8

File tree

2 files changed

+13
-14
lines changed

2 files changed

+13
-14
lines changed

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

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,19 @@ public String gameResult(ListNode head) {
1010
int even = 0;
1111
int odd = 0;
1212

13-
while(head != null && head.next != null){
13+
while (head != null && head.next != null) {
1414
if (head.val > head.next.val) {
15-
even++;
16-
} else if(head.val < head.next.val) {
17-
odd++;
15+
even++;
16+
} else if (head.val < head.next.val) {
17+
odd++;
1818
}
1919
head = head.next.next;
2020
}
21-
22-
if(even > odd){
23-
return "Even";
24-
}
25-
else if(even < odd ){
26-
return "Odd";
21+
22+
if (even > odd) {
23+
return "Even";
24+
} else if (even < odd) {
25+
return "Odd";
2726
}
2827
return "Tie";
2928
}

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ public Stack() {
99
}
1010

1111
public void push(int value) {
12-
top = new ListNode(value, top);
12+
top = new ListNode(value, top);
1313
}
1414

1515
public int pop() {
16-
int value = top.val;
17-
top = top.next;
18-
return value;
16+
int value = top.val;
17+
top = top.next;
18+
return value;
1919
}
2020

2121
public int peek() {

0 commit comments

Comments
 (0)