educative.io

Error in solution

I think there is an error in the solution. The requirements ask for the order of the negative and positive numbers to be maintained. But in your second solution, the order of the positive numbers in the last changes from 2, 4, 8 to 8, 4, 2.

Hi Hasan Zaidi,

This is Arqam from Educative. We are pleased to hear from you.

The requirement to maintain the order is just to pass the test cases. The goal is to shift all the negative numbers towards the left and all the positive numbers towards the right.

Thanks & Regards,

Arqam Rehan