Combinations
摘要:
Given two integersnandk, return all possible combinations ofknumbers out of 1 ...n.For example,Ifn= 4 andk= 2, a solution is:[ [2,4], [3,4], [2,3], [1,2], [1,3], [1,4],]思路:DFS另外,用next permutation里提到的方法也可以。代码: 1 void search(int start, int n, int k, vector > &result, vector &tmp){ 2 ... 阅读全文
posted @ 2013-11-06 21:16 waruzhi 阅读(197) 评论(0) 推荐(0)
浙公网安备 33010602011771号