1449. Form Largest Integer With Digits That Add up to Target
Description
**Input:** cost = [4,3,2,5,6,7,2,5,5], target = 9
**Output:** "7772"
**Explanation:** The cost to paint the digit '7' is 2, and the digit '2' is 3. Then cost("7772") = 2*3+ 3*1 = 9. You could also paint "977", but "7772" is the largest number.
**Digit cost**
1 -> 4
2 -> 3
3 -> 2
4 -> 5
5 -> 6
6 -> 7
7 -> 2
8 -> 5
9 -> 5ac
Previous1448. Count Good Nodes in Binary TreeNext1450. Number of Students Doing Homework at a Given Time
Last updated