Best Solution Using set || Easy to Understand
Approach\nStep 1 : Define a map and empty stirng\nStep2 : insert prefixes in map\nStep3 : check how many array of words element is present in map\n\n\n\nclass S
Approach\nStep 1 : Define a map and empty stirng\nStep2 : insert prefixes in map\nStep3 : check how many array of words element is present in map\n\n\n```\nclass Solution {\npublic:\n    int countPrefixes(vector<string>& words, string s) {\n        unordered_set<string> mp;\n        string st = "";\n        for(int i=0;i<s.length();i++){\n            st += s[i];\n            mp.insert(st);\n        }\n        int k=0;\n        for(auto it:words){\n            if(mp.count(it)){\n                k++;\n            }\n        }\n        return k;\n    }\n};\n```\n\n# ****PLEASE UPVOTE
['String', 'C']