Minimum Operations to Sort a String
One operation sorts any substring shorter than the whole string into alphabetical order. Find the fewest operations that sort the string, or -1 if that is impossible.
One operation sorts any substring shorter than the whole string into alphabetical order. Find the fewest operations that sort the string, or -1 if that is impossible.