Smallest String With A Given Numeric Value
Build the lexicographically smallest string of a fixed length whose letter values sum to a target. The visual fills positions from the end, placing the largest letter that still leaves room for the rest.
Build the lexicographically smallest string of a fixed length whose letter values sum to a target. The visual fills positions from the end, placing the largest letter that still leaves room for the rest.