Skip to content

Commit 672ce73

Browse files
author
AmiyahJo
committed
feat: adds comments
Breaking down the objective explained in a way for me to understand
1 parent 92891f6 commit 672ce73

File tree

1 file changed

+16
-0
lines changed
  • lesson_12/structs_java/structs_app/src/main/java/com/codedifferently/lesson12

1 file changed

+16
-0
lines changed

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,21 @@ public class Lesson12 {
88
*/
99
public String gameResult(ListNode head) {
1010
return null;
11+
//make a linked list
12+
13+
//create two variables to count points for "Odd" and "Even"
14+
15+
// Check each pair of nodes (odd and even):
16+
// compare their values
17+
18+
// add a point to "Odd" if the odd-indexed node is higher
19+
20+
//add a point to "Even" if the even-indexed node is higher
21+
22+
// Decide the winner
23+
// compare the points after going through both pairs
24+
25+
// Return the name of the winning team or "Tie" if points are equal
26+
1127
}
1228
}

0 commit comments

Comments
 (0)