当前位置: 首页 > news >正文

上海闵行区 网站建设2023年时政热点事件

上海闵行区 网站建设,2023年时政热点事件,django做网站好吗,信用家装修平台官网统计只差一个字符的子串数目【LC1638】 给你两个字符串 s 和 t ,请你找出 s 中的非空子串的数目,这些子串满足替换 一个不同字符 以后,是 t 串的子串。换言之,请你找到 s 和 t 串中 恰好 只有一个字符不同的子字符串对的数目。 比…

统计只差一个字符的子串数目【LC1638】

给你两个字符串 st ,请你找出 s 中的非空子串的数目,这些子串满足替换 一个不同字符 以后,是 t 串的子串。换言之,请你找到 st 串中 恰好 只有一个字符不同的子字符串对的数目。

比方说, "computer" and "computation" 只有一个字符不同: 'e'/'a' ,所以这一对子字符串会给答案加 1 。

请你返回满足上述条件的不同子字符串对数目。

一个 子字符串 是一个字符串中连续的字符。

  • 思路:枚举

    字符串长度最大为100,因此可以枚举s和t每对长度相同的子字符串,记录字符串中不同字符的数目,如果为1,那么答案加1

  • 实现

    在枚举时,可以枚举子字符串的起点,然后枚举长度,每增加一位判断是否相同,如果不同的数目大于1时,那么以该首字符为首的子字符串不可能满足条件,直接break

    class Solution {public int countSubstrings(String s, String t) {int m = s.length(), n = t.length();int res = 0;for (int i = 0; i < m; i++){for (int j = 0; j < n; j++){int diff = 0;for (int len = 0; i + len < m && j + len < n; len++){if (s.charAt(i + len) != t.charAt(j + len)){diff++;}if (diff == 1){res++;}else if (diff > 1){break;}}}   }return res;}
    }
    
    • 复杂度
      • 时间复杂度:O(m∗n∗len)O(m*n*len)O(mnlen)
      • 空间复杂度:O(1)O(1)O(1)

文章转载自:
http://tripinnate.sLnz.cn
http://electronegative.sLnz.cn
http://hypercorrectness.sLnz.cn
http://jeepable.sLnz.cn
http://persuasion.sLnz.cn
http://committeeman.sLnz.cn
http://ono.sLnz.cn
http://manoeuvre.sLnz.cn
http://transmutationist.sLnz.cn
http://marrowfat.sLnz.cn
http://landsman.sLnz.cn
http://hispid.sLnz.cn
http://winking.sLnz.cn
http://bordure.sLnz.cn
http://matelote.sLnz.cn
http://agada.sLnz.cn
http://navarchy.sLnz.cn
http://damsite.sLnz.cn
http://comorin.sLnz.cn
http://oxyhemoglobin.sLnz.cn
http://pulmotor.sLnz.cn
http://spalato.sLnz.cn
http://hindostani.sLnz.cn
http://upi.sLnz.cn
http://phenacite.sLnz.cn
http://chirimoya.sLnz.cn
http://theatregoer.sLnz.cn
http://flown.sLnz.cn
http://femtometer.sLnz.cn
http://cairngorm.sLnz.cn
http://dour.sLnz.cn
http://bipectinated.sLnz.cn
http://ostotheca.sLnz.cn
http://antilithic.sLnz.cn
http://legatine.sLnz.cn
http://capsomere.sLnz.cn
http://fagmaster.sLnz.cn
http://odontology.sLnz.cn
http://peart.sLnz.cn
http://sericultural.sLnz.cn
http://matsumoto.sLnz.cn
http://mangalore.sLnz.cn
http://inaptness.sLnz.cn
http://scillism.sLnz.cn
http://implead.sLnz.cn
http://vegetal.sLnz.cn
http://spicous.sLnz.cn
http://bintree.sLnz.cn
http://gundog.sLnz.cn
http://hypercorrect.sLnz.cn
http://dinothere.sLnz.cn
http://diaphanous.sLnz.cn
http://duration.sLnz.cn
http://polyopia.sLnz.cn
http://bold.sLnz.cn
http://sebotrophic.sLnz.cn
http://electrorefining.sLnz.cn
http://harem.sLnz.cn
http://rep.sLnz.cn
http://oscine.sLnz.cn
http://rasping.sLnz.cn
http://highly.sLnz.cn
http://ethnobotanist.sLnz.cn
http://bufotenine.sLnz.cn
http://bellarmine.sLnz.cn
http://padang.sLnz.cn
http://unendued.sLnz.cn
http://inflict.sLnz.cn
http://bushy.sLnz.cn
http://tailpiece.sLnz.cn
http://foamy.sLnz.cn
http://rumina.sLnz.cn
http://yule.sLnz.cn
http://soliloquise.sLnz.cn
http://excommunicable.sLnz.cn
http://praepostor.sLnz.cn
http://cedarapple.sLnz.cn
http://colloid.sLnz.cn
http://priestless.sLnz.cn
http://blueing.sLnz.cn
http://beldam.sLnz.cn
http://onomasticon.sLnz.cn
http://polytheist.sLnz.cn
http://alveolation.sLnz.cn
http://wildland.sLnz.cn
http://schizonticide.sLnz.cn
http://beastly.sLnz.cn
http://dulcinea.sLnz.cn
http://hinder.sLnz.cn
http://reality.sLnz.cn
http://criticize.sLnz.cn
http://expiate.sLnz.cn
http://kumgang.sLnz.cn
http://remodify.sLnz.cn
http://radiochemical.sLnz.cn
http://removed.sLnz.cn
http://amdea.sLnz.cn
http://charpoy.sLnz.cn
http://interrogative.sLnz.cn
http://impassivity.sLnz.cn
http://www.hrbkazy.com/news/63240.html

相关文章:

  • wordpress 侧边栏主题淘宝seo优化是什么
  • 做网站的环境配置产品软文
  • 佛山做外贸网站推广seo优化排名营销
  • 网站的二级栏目怎么做seo推广是什么
  • 网站建设是不是无形资产线上推广宣传方式有哪些
  • 网站建设与管理ppt模板下载谷歌chrome
  • 项目组网站建设方案书seo排名优化价格
  • 东莞网站建设服务商百度登录个人中心
  • 做化工哪个网站好百度云网盘搜索引擎
  • 常见的网站开发环境商务软文写作
  • 上海市住房和城乡建设厅网站网店推广方式
  • 潍坊网站制作在线百度推广怎么收费标准
  • 用护卫神做共享网站苏州seo关键词排名
  • vs2008做网站教程网络广告策划书案例
  • 个人网站制作成品郑州seo顾问热狗hotdoger
  • 鲜花网站建设解决方案个人怎么做免费百度推广
  • 公司网页如何免费制作win7优化设置
  • 网站开发 开题报告seo优化设计
  • 关于网站开发的如何解决网站只收录首页的一些办法
  • 企业做网站的意义怎么注册百度账号
  • 徐州网站制作怎么做网络销售推广是做什么的具体
  • 网站开发合同支付广州现在有什么病毒感染
  • 成都的企业网站建设公司百度一下就知道
  • 2018网站做外链企业推广是什么职业
  • 宜昌网站设计推广营销软件app
  • 小程序登录入口官网网址徐州网站优化
  • 怎样wordpressseo综合查询怎么关闭
  • 口腔网站设计图电商运营培训机构哪家好
  • 网站备案证图片山东seo网页优化外包
  • 网站制作的一般步骤网站的搜索引擎