educative.io

Test case is misleading

The title of the challenge specifically says that we should find Two numbers that add up to number n.
the First test case expects an array with more than two elements as you can see.

I think this is a mistake and it should be fixed


Course: https://www.educative.io/courses/data-structures-in-java
Lesson: Educative: Interactive Courses for Software Developers

Yes, you’re correct, the expected output is actually showing the original array and its sorted form in the first test case.

This is still the case, after a year July 31st,2023. Please someone fix this

Hi @Jimmy_Sinjaradze
Thank you for reaching out to the Educative Team.

The problem statement for this challenge specifies that “You are required to return only one such pair. If no such pair is found then simply return the array.” That’s why this test case expected output is the original array, and sorted array can also be considered a valid return value, as the solution initially employs a quick sort algorithm to sort the array.

I hope this helps.

1 Like