思路: 只要枚举最终匹配的子串是从s中的哪个字符开始的就好了,并记录最小值。 代码: #include <iostream> #include <string.h> using namespace std; int main() { // please define the C++ input he Read More
posted @ 2022-01-28 09:38 A-inspire Views(41) Comments(0) Diggs(0) Edit
思路: 采用双指针方法遍历字符串; 1)初始时左右边界指针都指向位置0; 2)边界判断:左元音右缺陷(right++)、左缺陷右元音(left++)、左右都缺陷(left++、right++)、左右都元音(计算缺陷度); 3)计算元音字串的长度: 1. 先判断当前缺陷度是否满足要求,小于则right Read More
posted @ 2022-01-28 09:25 A-inspire Views(1258) Comments(0) Diggs(0) Edit