Sort the substring

Its easy. Simply, use sort(str.begin+n,str.begin+m+1)
and reverse(str.begin+n,str.begin+m+1)

I am not sure, but won’t this work too?

sort(str.begin() + n, str.begin() + m + 1, greater<char>());

@panda27 , this is not from an ongoing contest, right?

Yes it will. Ek e baat h

Sir, can I get all code. M learner to c# and m not familiar with each code so can you help me .
At the act of kindness.
I shall always greatful to you.
Actually my brother is doing his assignments and he is trying since 3 day but he can’t find out solutions
@ashish_kaur

No Suman_18733097

Sir this is my brother assignment and I have seen he solving this question since last three day but can’t get solutions please help him .
Can you give me code?

It doesn’t look like an assignment. Anyways, I am not aware of C#, so I may not be able to help.