Spring Hire Sale
Limited Time Deal: Unlock all premium questions for over 30% off
$10.42$7.08
08
:
03
:
10
:
56
Back to Dashboard
Digit Replacement Maximizer
Medium
A numeric optimization system performs exactly k substitution operations on a number string s. In each operation, choose any digit in s that is not "7" and replace it with "7". Find the largest possible number after performing exactly k operations.
If it is impossible to perform exactly k operations (because there are fewer than k non-"7" digits), return an empty string.
...