标签:subject ack 查找 content bsp 一个 back push 输出
class Solution { public: vector<int> FindNumbersWithSum(vector<int> array,int sum) { vector<int> result; int len = array.size(); int mul = 10000; for(int i=0;i<len;i++){ int temp = sum-array[i]; for(int j=len-1;j>i;j--){ if(temp==array[j]){ if(array[i]*array[j]<mul){ result.clear(); result.push_back(array[i]); result.push_back(array[j]); mul = array[i]*array[j]; } } } } return result; } };
标签:subject ack 查找 content bsp 一个 back push 输出
原文地址:https://www.cnblogs.com/loyolh/p/12569257.html