Sponsored
Use these hints if you're stuck. Try solving on your own first.
Use dynamic programming to find the maximum digits to paint given a total cost.
Build the largest number possible using this DP table.
Solve with full IDE support and test cases