Definition at line 5 of file main.cpp.
◆ prefixCount()
| int Solution::prefixCount |
( |
vector< string > & |
words, |
|
|
string |
pref |
|
) |
| |
|
inline |
Definition at line 8 of file main.cpp.
9 {
10 int count = 0;
11 for (string& word: words)
12 {
13 for (int i = 0; i < (int)pref.size(); ++i)
14 {
15 if (pref[i] != word[i])
16 break;
17 else
18 if (i + 1 == (int)pref.size())
19 count++;
20 }
21 }
22 return count;
23 }
Referenced by main().
The documentation for this class was generated from the following file: