Available question text
Given costs for digits 1–9 and a total budget target, return the largest possible positive integer (as a string) whose digits' costs sum exactly to target, or "0" if impossible. This is an exact-knapsack dynamic programming problem: maximize the number (length) of digits and then pick the lexicographically/largest numeric arrangement (prefer higher digits) while ensuring feasibility for the remaining cost.
Related questions
Continue with questions that share topics or the same question type.
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 1449. Form Largest Integer With Digits That Add up to Target
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source