class Solution {
public:
int getNumberOfK(vector<int>& nums , int k) {
while(!nums.empty()){ //动态数组nums为空的时候返回ture,nums不为空的时候返回false
if(nums.back()==k)
count++;
nums.pop_back();
}
return count;
}
int count;
};