mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-11-30 18:36:27 +00:00
11 lines
192 B
C++
11 lines
192 B
C++
|
class Solution {
|
||
|
public:
|
||
|
int getNumberOfK(vector<int>& nums, int k) {
|
||
|
int ans = 0;
|
||
|
for (int i : nums) {
|
||
|
ans += i == k;
|
||
|
}
|
||
|
return ans;
|
||
|
}
|
||
|
};
|