贪心算法,按照题目的描述 增加一个修正策略 然后滑动 #include <iostream> // 滑动窗口 贪心 using namespace std; int getMax(string &s, int m, char target) { int left = 0, right = 0; int result = 0, index = 0; int n = s.size(); while (right < n) { if (s[right] == target) { right++; ...