File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
lesson_12/structs_java/structs_app/src/main/java/com/codedifferently/lesson12 Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -9,9 +9,13 @@ public class Lesson12 {
9
9
public String gameResult (ListNode head ) {
10
10
return null ;
11
11
//make a linked list
12
-
12
+ Queue <Integer > queue = new LinkedList <Integer >();
13
+
13
14
//create two variables to count points for "Odd" and "Even"
14
-
15
+ var Odd = new Stack <Integer >();
16
+ var Even = new Stack <Integer >();
17
+ // Loop through the linked list to get pairs (so two nodes at a time)
18
+
15
19
// Check each pair of nodes (odd and even):
16
20
// compare their values
17
21
@@ -21,7 +25,7 @@ public String gameResult(ListNode head) {
21
25
22
26
// Decide the winner
23
27
// compare the points after going through both pairs
24
-
28
+
25
29
// Return the name of the winning team or "Tie" if points are equal
26
30
27
31
}
You can’t perform that action at this time.
0 commit comments