You are given a string s consisting of lowercase English letters and the character '?'.
For any string, the cost of the character at index i is defined as the number of times the character s[i] appears before index i (that is, at indices s.length
Replace every '?' in s with a lowercase English letter such that the total value of the string is minimized. If there are multiple strings that achieve the minimum total value, return the lexicographically smallest one.
Constraints:
s.length
s[i] is either a lowercase English letter or '?'.
You are given a string s consisting of lowercase English letters and the character '?'.
For any string, the cost of the character at index i is defined as the number of times the character s[i] appears before index i (that is, at indices s.length
Replace every '?' in s with a lowercase English letter such that the total value of the string is minimized. If there are multiple strings that achieve the minimum total value, return the lexicographically smallest one.
Constraints:
s.length
s[i] is either a lowercase English letter or '?'.