Your Dashboard
Interview Coaching
Learn
System Design
ML System Design
Code
Behavioral
Salary Negotiation
Interview Guides
Search
⌘K
Get Premium
Leetcode 2915. Length of the Longest Subsequence That Sums to Target
Find the maximum length subsequence of positive integers that sums exactly to target (or return -1 if none exists). This is a 0/1 knapsack–style problem: choose a subset in order that maximizes item count under the sum constraint (feasible with DP given nums.length and target ≤ 1000).
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.