摘要: Code:class Solution {public: void merge(int A[], int m, int B[], int n) { int i, j, count; for(i=0,j=0;i=B[j];j++) // count how many smaller than i count++; if(count>0){ // if there are some elements from B that need to insert into A for(int ... 阅读全文
posted @ 2013-10-28 07:45 WinsCoder 阅读(143) 评论(0) 推荐(0) 编辑
摘要: Code:O(n):class Solution {public: vector twoSum(vector &numbers, int target) { vector res; map mapping; int n=numbers.size(); for (int i=0; i twoSum(vector &numbers, int target) { vector res; int n=numbers.size(); for(int i=0;i<n;i++) fo... 阅读全文
posted @ 2013-10-28 00:24 WinsCoder 阅读(101) 评论(0) 推荐(0) 编辑