Count Prefixes of a Given String Solution in C++
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\nO(n*m)\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\nO(n)\n# Code\n```\nclass Solution {\npublic:\n    int countPrefixes(vector<string>& words, string s) {\n        int i, j, count=0;\n        string str="";\n        for(i=0 ; i<s.length() ; i++)\n        {\n            str += s[i];\n            for(j=0 ; j<words.size() ; j++)\n            {\n                if(str==words[j])\n                {\n                    count++;\n                }\n            }\n        }\n        return count;\n    }\n};\n```
['C++']