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],]不知道有没有更好的方法。class Solution {public: vector > re; vector > combine(int n, int k) { vector m; if(n already... 阅读全文
posted @ 2014-03-13 21:06 pengyu2003 阅读(126) 评论(0) 推荐(0)
浙公网安备 33010602011771号