摘要: Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two numbers such that they add up to the target, where index1 must be less than index2. Please note that your returned answers (both index1 and index2) are 阅读全文
posted @ 2013-01-19 19:33 西施豆腐渣 阅读(132) 评论(0) 推荐(0) 编辑
摘要: Given a collection of numbers, return all possible permutations.For example,[1,2,3]have the following permutations:[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,1,2], and[3,2,1].class Solution { public: vector<vector<int> > permute(vector<int> &num) { // Start typing your C/C++ solution b 阅读全文
posted @ 2013-01-19 08:29 西施豆腐渣 阅读(219) 评论(0) 推荐(0) 编辑