Skip to content

Commit c03667f

Browse files
author
AmiyahJo
committed
feat: adds code snippets
pulled from the google slides to refrence what should be used
1 parent 672ce73 commit c03667f

File tree

1 file changed

+7
-3
lines changed
  • lesson_12/structs_java/structs_app/src/main/java/com/codedifferently/lesson12

1 file changed

+7
-3
lines changed

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,13 @@ public class Lesson12 {
99
public String gameResult(ListNode head) {
1010
return null;
1111
//make a linked list
12-
12+
Queue<Integer> queue = new LinkedList<Integer>();
13+
1314
//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+
1519
// Check each pair of nodes (odd and even):
1620
// compare their values
1721

@@ -21,7 +25,7 @@ public String gameResult(ListNode head) {
2125

2226
// Decide the winner
2327
// compare the points after going through both pairs
24-
28+
2529
// Return the name of the winning team or "Tie" if points are equal
2630

2731
}

0 commit comments

Comments
 (0)