摘要:
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 ... 阅读全文
摘要:
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... 阅读全文