✅ 2 Lines   || C++ / java
Apply find() in case of c++ and indexof() in case of java on every word and check if return position is 0.\nReturn the count of such strings.\n# C++\n    int co
Apply **find()** in case of c++ and **indexof()** in case of java on every word and check if return position is 0.\nReturn the count of such strings.\n# C++\n    int countPrefixes(vector<string>& words, string s, int cnt=0){\n        for(auto i:words) if(s.find(i)==0) cnt++;\n        return cnt;\n    }\n\t\n# Java\n    public int countPrefixes(String[] words, String s) {\n        int cnt=0;\n        for(var i:words) if(s.indexOf(i)==0) cnt++;\n        return cnt;\n    }
['C', 'Java']