Sum of Beauty of All Substrings(C++所有子字符串美丽值之和)

(1)hash+滑窗

class Solution {
private:
    int maxs=0,mins=INT_MAX;
public:
    void helper(vector &v) {
        maxs=0,mins=INT_MAX;
        for(int i=0;iv[i] && v[i]!=0) mins=v[i];
            if(maxs v(26,0);
            for(int j=i;j

 

你可能感兴趣的:(C++,LeetCode,数据结构,c++,hash)