//题目描述:
//给定一个字符串 s 和一个非空字符串 p,找到 s 中所有是 p 的字母异位词的子串,返回这些子串的起始索引。
//字母异位词指的是由相同的字母按不同的顺序组成的单词。比如,“listen”和“silent”就是字母异位词
//
//C++ main 函数:
//
//cpp
#include <iostream>
#include <string>
#include <vector>
#include <unordered_map>
using namespace std;
//1.判断函数+遍历子串
bool is(string s, int i, int j,string p) {
unordered_map<char,int> l;
for (int c = i; c <= j; c++) {
l[s[c]]++;
}
for (int g : p) {
l[g]--;
}
for (auto y : l) {
if (y.second != 0) {
return false;
}
}
return true;
}
vector<int> findAnag