problemscpp
A collection of my answers to algorithm problems in c++.
静态 Public 成员函数 | 所有成员列表
leetcode::counting_words_with_a_given_prefix::Solution类 参考

#include <leetcode.h>

静态 Public 成员函数

static int prefixCount (vector< string > &words, string pref)
 

详细描述

在文件 leetcode.h1379 行定义.

成员函数说明

◆ prefixCount()

int leetcode::counting_words_with_a_given_prefix::Solution::prefixCount ( vector< string > &  words,
string  pref 
)
static

在文件 leetcode.cpp3576 行定义.

3576 {
3577 int ans = 0;
3578 for(auto word: words) {
3579 bool ok = true;
3580 for(int i = 0; i < pref.length(); i++) {
3581 if(pref[i] != word[i]) {
3582 ok = false;
3583 break;
3584 }
3585 }
3586 if(ok) {
3587 ans++;
3588 }
3589 }
3590 return ans;
3591 }

被这些函数引用 leetcode::counting_words_with_a_given_prefix::TEST().


该类的文档由以下文件生成: