剑指 Offer 53 - I. 在排序数组中查找数字 I
题目
题目链接
https://leetcode-cn.com/problems/zai-pai-xu-shu-zu-zhong-cha-zhao-shu-zi-lcof/
具体代码
class Solution {
public int search(int[] nums, int target) {
int time = 0;
for (int num : nums) {
if (num == target) {
time++;
}
}
return time;
}
}