摘要: class Solution { public: int maxProfit(vector<int>& prices) { int counter=0;int ans=0; for(int i=1;i<prices.size();i++) { counter+=prices[i]-prices[i- 阅读全文
posted @ 2022-03-01 21:05 fengmao31 阅读(26) 评论(0) 推荐(0) 编辑
摘要: class Solution { public: int singleNumber(vector<int>& nums) { int n=0; for(auto a:nums) { n^=a; } return n; } }; 阅读全文
posted @ 2022-03-01 19:46 fengmao31 阅读(13) 评论(0) 推荐(0) 编辑