Optimizes Roman numeral string to shortest valid string