educative.io

The algorithm specified in the solution is buggy

The output for insertInterval2([][]int{{1, 6}, {8, 9}, {10, 15}, {16, 18}}, []int{1, 10}) returns empty slice, but according to the task statement the expected supposed to be [{1,15},{16,18}]. I am writing about the solution for Go.

1 Like

Hello @Arkady,

I’ve tried debugging the test case you’ve provided against the code widget in the solution lesson. It seems to be working fine at my end, I’ve attached screenshot below for your convenience. If you try adding the same test case in last code widget under the “Just the code” heading, you’ll see that the expected output is correctly generated.

Do share any update on this, we’ll look into it and fix for you at the earliest. Thanks!

Happy learning!