题解 | #词频统计#
词频统计
https://www.nowcoder.com/practice/ebff2814640a48fdb0d9690677f7c7de
#include <iostream>
#include <vector>
using namespace std;
class Frequency {
public:
int getFrequency(vector<string>& article, int n, string word) {
int count = 0;
for (int i = 0; i < n; ++i) {
if (article[i]==word) {
count++;
}
}
return count;
}
};
正浩创新EcoFlow公司福利 754人发布