vector<int> findAnagrams(string s, string t) {unordered_map<char, int> needs;unordered_map<char, int> window;for(char c : t){++needs[c];}int match = 0, start = 0, left = 0, right = 0, len = s.length(), minLen = INT_MAX;vector<int> res;while(right < len){char c1 = s[right];if(needs.count(c1)){++window[c1];if(window[c1] == needs[c1]){++match;}}++right;while(match == needs.size()){if(right - left == t.size()){res.push_back(left);}char c2 = s[left];if(needs.count(c2)){--window[c2];if(window[c2] < needs[c2]){--match;}}++left;}}return res;}
