题目描述
统计一个数字在排序数组中出现的次数。
题目连接:
public class Solution { public int GetNumberOfK(int [] array , int k) { int count = 0; for(int i =0;i < array.length;i++){ if(k == array[i]){ count++; continue; } if(count !=0){ break; } } return count; } }