📌 [JAVA] | Simple
```\nclass Solution {\n    public int countPrefixes(String[] words, String s) {\n    \n       int preFixCount=0;\n       for(String curr:words){\n           int
```\nclass Solution {\n    public int countPrefixes(String[] words, String s) {\n    \n       int preFixCount=0;\n       for(String curr:words){\n           int i=0;\n           \n           if(curr.length()>s.length())     // if current  string length greater than s length invalid prefix\n           continue; \n           int j;\n           for(j=0;j<curr.length();j++,i++){\n               if(curr.charAt(j)==s.charAt(i))\n               continue;\n               else \n               break;\n                   \n           }\n           if(j==curr.length())             // if all character matches than mark valid \n           preFixCount++;\n       }\n     return preFixCount;     \n    }\n   \n}
['Java']