摘要:
if(prices.empty()) return 0 ; int max = 0; /* 定义最大利润 */ int min = prices[0]; for(int i = 1 ; i < prices.size() ; i++ ) { if(prices[i] < min) min = pri 阅读全文
摘要:
if(nums.empty()) return 0 ; int len = nums.size(); int a = 1 ; for(int i=1;i<len;i++) { if(nums[i]!=nums[a-1]) { nums[a++] = nums[i]; } } return a; 阅读全文