题解 | #数字在升序数组中出现的次数#
数字在升序数组中出现的次数
https://www.nowcoder.com/practice/70610bf967994b22bb1c26f9ae901fa2
function GetNumberOfK(data, k)
{
// write code here
let result = 0
data.forEach(item => {
if(item === k) result++
})
return result
}
module.exports = {
GetNumberOfK : GetNumberOfK
};
#前端工程师#
{
// write code here
let result = 0
data.forEach(item => {
if(item === k) result++
})
return result
}
module.exports = {
GetNumberOfK : GetNumberOfK
};
#前端工程师#