Problem 1830 · Hard

Minimum Number of Operations to Make String Sorted

The answer counts the distinct arrangements that sort before the string, built letter by letter with multinomial coefficients.

Open the interactive visualisation