Java 代码
class Solution
{
public int getNumberOfK(int[] nums, int k)
{
int count = 0;
for (int i = 0; i < nums.length; i ++)
{
if (nums[i] == k)
count += 1;
}
return count;
}
}