Ive been struggling for 3 hours straight and I’m still not able to find the solution to and get an AC in the problem . You can get the question above .
Just Applying the brute force , getting the smallest number , and putting in the leftmost position possible . and while putting it making sure that , the i -th operation is never performed while maintaining a check array .
I’m Not able to get the answer , somebody Please help .