Not able to clear test cases

hello @Bhavya_Goel
in these problem relative ordering shuld also be same.
for example if in given list 2 comes before 4
then after applying algorithm the relative order should remian same
i,e 2 should vome before 4.

this is missing in ur code.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.