https://ide.codingblocks.com/s/443596,
please check what is problem in my code?
Unlock Problem , , , , ,
hello @CODER_JATIN
bro thoda logic galat hai tumhara, humare paas number of swaps limited hai right?
to hame sabse pehle jo sabse bada number hoga usko sahi place pe rakhna chaiye haina?
aur same hi logic baaki remaining element pe repeat karna chaiye haina?
hanji bhaiya … …
to array ko sort kar du pehle ?
nlogn mai? . . . .
nahi, tum diya hua hai ki element saare 1 se n me hi hai.
to tum kya karo ki n se iterate karo, dekho ki n kaha hai ,agar wo 0th index pe hai phir to kuch nahi karna ,next n-1 ko dekho
otherwise n ko correct position pe le aao, aur phir n-1 pe contrinue karo
Okay bhaiya , done hai , thank you !!.
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.