DNF Sort Problem


Why I am not getting correct output??

hello @ashwani225
use if - else if - else in place of if if if

Ok it worked. But in the video bhaiya has used only if condition and it worked??

see using if ,else ,else ensures that we perform only one updation at a time .

bhaiya solution worked may be because when he submitted his solution then test cases were different

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.