The testcase shows that the output i got is wrong but the same code gives correct output on vs code and other compilers The first image is the testcase, you can see the expected output as [3, 1, 2] ...