首页 > 其他 > 详细

90 k数和 II

时间:2018-07-16 20:20:38      阅读:165      评论:0      收藏:0      [点我收藏+]

原题网址:https://www.lintcode.com/problem/k-sum-ii/description

描述

Given n unique integers, number k (1<=k<=n) and target.

Find all possible k integers where their sum is target.

您在真实的面试中是否遇到过这个题?  

样例

给出[1,2,3,4],k=2, target=5,返回 [[1,4],[2,3]]

 

 

标签
LintCode 版权所有
Depth-first Search(DFS)
 
 
思路:深度优先搜索(DFS是一个递归的过程)
 
 
 
参考:
 

 

90 k数和 II

原文:https://www.cnblogs.com/Tang-tangt/p/9319849.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!