三且专题

LeetCode 1876. 长度为三且各字符不同的子字符串

解题思路 滑动窗口的经典题型,直接套模板就行了。 相关代码 class Solution {public int countGoodSubstrings(String s) {char c[] = s.toCharArray();int hash[] = new int[26];int k=0;for(int i=0,j=0,cnt=0;i<c.length;i++){hash[c[i]-'