LeetCode 904. 水果成籃

方法一:滑動窗口 思路:首先找到第三種樹,更新2種樹窗口向右滑動,左指針左移,右指針右移增大長度web class Solution { public: int totalFruit(vector<int>& tree) { int res = 0, one = tree[0], two; int begin = 0, end = 1, len = tree
相關文章
相關標籤/搜索