← 返回 google 的题目列表Dynamic Programming Question
类型:online_judge
Given an integer array nums and a target integer target, find the indices of the longest subsequence that adds up to target. Solve this in O(n) complexity.
Example
Input
nums = [1, 2, 3, 4, 5], target = 7
Output
Indices: [1, 2, 3] Length: 3