How to solve this string problem?

Revision en1, by Hz_, 2020-12-31 18:55:55

Problem link

Problem statement
INPUT and OUTPUT format
SAMPLE

I don't understand why my code is getting wrong?

My approach to making the string non-decreasing as much as possible.

Can anyone please help me to fix my code for this problem or tell me a good approach to solve this problem?

*Now the submit option for this problem is disabled. It will be better if someone comes up with proof of his/her solution.:)

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English Hz_ 2020-12-31 18:55:55 1807 Initial revision (published)