File tree Expand file tree Collapse file tree 2 files changed +18
-18
lines changed
lesson_12/structs_java/structs_app/src/main/java/com/codedifferently/lesson12 Expand file tree Collapse file tree 2 files changed +18
-18
lines changed Original file line number Diff line number Diff line change @@ -9,21 +9,21 @@ public String gameResult(ListNode head) {
9
9
10
10
ListNode current = head ;
11
11
12
- while (current != null && current .next != null ) {
13
- if (current .val > current .next .val ){
14
- evenPoints ++;
15
- } else if (current .val < current .next .val ){
16
- oddPoints ++;
17
- }
18
- current = current .next .next ;
12
+ while (current != null && current .next != null ) {
13
+ if (current .val > current .next .val ) {
14
+ evenPoints ++;
15
+ } else if (current .val < current .next .val ) {
16
+ oddPoints ++;
19
17
}
18
+ current = current .next .next ;
19
+ }
20
20
21
- if (oddPoints > evenPoints ) {
22
- return "Odd" ;
23
- } else if (evenPoints > oddPoints ){
24
- return "Even" ;
25
- } else {
26
- return "Tie" ;
27
- }
21
+ if (oddPoints > evenPoints ) {
22
+ return "Odd" ;
23
+ } else if (evenPoints > oddPoints ) {
24
+ return "Even" ;
25
+ } else {
26
+ return "Tie" ;
27
+ }
28
28
}
29
29
}
Original file line number Diff line number Diff line change @@ -18,11 +18,11 @@ public void push(int value) {
18
18
19
19
public int pop () {
20
20
if (isEmpty ()) {
21
- throw new EmptyStackException ();
21
+ throw new EmptyStackException ();
22
22
} else {
23
- int value = top .val ;
24
- top = top .next ;
25
- return value ;
23
+ int value = top .val ;
24
+ top = top .next ;
25
+ return value ;
26
26
}
27
27
}
28
28
You can’t perform that action at this time.
0 commit comments