educative.io

Different input format for Try it Yourself and Solution - causing failure

In the Golang Course for Grokking the Coding Interview. Even if I copy and paste the code from the Solution into the Try it Yourself code block for the Linked List Cycle challenge, it fails.

I noticed the input format for Try it Yourself and Solution seem different. Try it Yourself specifies input as an array followed by an int: [2,4,6,8,10] , 2
[1,3,5,7,9] , -1
[1,2,3,4,5] , 3
[0,2,3,5,6] , -1
[3,6,9,10,11] , 0

Whereas the Solution code just defines a few arrays, and then creates a Linked List Cycle for the even index arrays:
inputArray := [][]int {
{2, 4, 6, 8, 10, 12},
{1, 3, 5, 7, 9, 11},
{0, 1, 2, 3, 4, 6},
{3, 4, 7, 9, 11, 17},
{5, 1, 4, 9, 2, 3},
}
for i, input := range inputArray {
linkedList := new(EduLinkedList)
linkedList.CreateLinkedList(input)
if i % 2 == 0 {
linkedList.head.next.next.next.next.next.next = linkedList.head.next
}


Course: https://www.educative.io/courses/grokking-coding-interview-patterns-go
Lesson: https://www.educative.io/courses/grokking-coding-interview-patterns-go/7n9qnVQgDLr

1 Like

Hi @AJ_Wallace ,
Thank you for contacting the Educative Team!

We can confirm that this was, indeed, an issue, and have fixed it. The fix will be live soon.

Hope you have an amazing experience learning on Educative!

@Abdullah_Saleem is the fix available now? iā€™m seeing the same issue still