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
相关文章
相关标签/搜索