Skip to content

Commit 7e39738

Browse files
author
AmiyahJo
committed
feat: adds constraints
1 parent c03667f commit 7e39738

File tree

1 file changed

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

1 file changed

+7
-1
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public String gameResult(ListNode head) {
1515
var Odd = new Stack<Integer>();
1616
var Even = new Stack<Integer>();
1717
// Loop through the linked list to get pairs (so two nodes at a time)
18-
18+
1919
// Check each pair of nodes (odd and even):
2020
// compare their values
2121

@@ -30,3 +30,9 @@ public String gameResult(ListNode head) {
3030

3131
}
3232
}
33+
34+
// Constraints:
35+
// The number of nodes in the list is in the range [2, 100].
36+
// The number of nodes in the list is even. 1 <= Node.val <= 100
37+
// The value of each odd-indexed node is odd.
38+
// The value of each even-indexed node is even.

0 commit comments

Comments
 (0)