class Solution {
public:
    vector<int> invertedIndex(vector<int>& ID, vector<string>& content, string word) {
        // write code here
        vector<int> ans;
        for(int i = 0;i<ID.size();i++)
        {
            for(int j = 0,k = 0;j<content[i].size();j++)
            {
                while(content[i][j]==word[k])
                {
                    j++;
                    k++;
                }
                if(k>=word.length())
                {
                    ans.push_back(ID[i]);
                    break;
                }
                else{
                    k = 0;
                }
            }
        }
        return ans;
    }
};