题目
Given n unique integers, number k (1<=k<=n) and target. Find all possible k integers where their sum is target.
Example
Given [1,2,3,4], k=2, target=5, [1,4] and [2,3] are possible solutions.
Tags Expand
LintCode Copyright Depth First Search
解题思路
和K Sum题类似,但是K Sum只能求到结果个数,但是无法获取历史路径,所以只能使用K Sum的思路一,深度搜索算法
代码
public class Solution {
/**
* @param A: an integer array.
* @param k: a positive integer (k <= lengt......
阅读全文