0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-08 16:18:46 +00:00

67. 数字在排序数组中出现的次数

https://www.acwing.com/problem/content/submission/code_detail/7757066/
This commit is contained in:
Baoshuo Ren 2021-09-16 16:08:55 +08:00 committed by Baoshuo Ren
parent 9adc6d8bb7
commit 32a72cdeb4
Signed by: baoshuo
GPG Key ID: 70F90A673FB1AB68

10
AcWing/67/67.cpp Normal file
View File

@ -0,0 +1,10 @@
class Solution {
public:
int getNumberOfK(vector<int>& nums, int k) {
int ans = 0;
for (int i : nums) {
ans += i == k;
}
return ans;
}
};