题解 | #子字符串频次#

子字符串频次

https://www.nowcoder.com/practice/053caf9d4d9d449bb45a6b02a572f71b

const _searchStrIndexOf = (str, target) => {
  // 补全代码
  if(str.length < target.length){
    return 0
  }
  const reg = new RegExp(str, 'g')
  return str.match(reg).length
}

全部评论

相关推荐

野猪不是猪🐗:还是太卑微了,什么叫放弃本次面试应该说经过评估,贵公司与自己不匹配,决定不再推进后续流程
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务