educative.io

Incorrect code. Output is incorrect

Hey so while checking out the JS code it doesnt return the correct out put for the case insert([[1,3],[6,9]] , [2,5]) …this returns [[2,5],[1,3],[6,9]] but should be [[1,5],[6,9]]. only tried out the JS version

Hey @Jeffrey_Pernia!
Thank you for asking the question. We have verified your test case. The code is working fine. Here is the screenshot for you.

We hope Educative has inspired you to further your learning. Thank you.

my apologies. you are right