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

做网站给菠菜引流收录优美图片app

做网站给菠菜引流,收录优美图片app,wordpress数据查询,做pc端的网站首页尺寸是多少说在前面 🎈不知道大家对于算法的学习是一个怎样的心态呢?为了面试还是因为兴趣?不管是出于什么原因,算法学习需要持续保持。 题目描述 给你一个字符串 s ,请找出满足每个字符最多出现两次的最长子字符串,…

说在前面

🎈不知道大家对于算法的学习是一个怎样的心态呢?为了面试还是因为兴趣?不管是出于什么原因,算法学习需要持续保持。

题目描述

给你一个字符串 s ,请找出满足每个字符最多出现两次的最长子字符串,并返回该子字符串的 最大 长度。

示例 1:

**输入:**  s = "bcbbbcba"**输出:**  4**解释:**以下子字符串长度为 4,并且每个字符最多出现两次:`"bcbbbcba"`。
**示例 2:****输入:**  s = "aaaa"**输出:**  2**解释:**以下子字符串长度为 2,并且每个字符最多出现两次:`"aaaa"`。

提示:

  • 2 <= s.length <= 100
  • s 仅由小写英文字母组成。

解题思路

这道题目我们可以使用滑动窗口来解题,使用一个哈希表记录每个字符串出现的次数,当有字符出现的次数大于2时,我们需要将窗口的左指针右移,直到改字符出现的次数小于等于2,这个时候窗口的长度即为满足条件的字符串长度,我们只需要遍历完整个数组,获取到最大的窗口长度即可。

AC代码

/*** @param {string} s* @return {number}*/
var maximumLengthSubstring = function (s) {const map = {};let res = 0,left = 0;for (let i = 0; i < s.length; i++) {let cnt = map[s[i]] || 0;map[s[i]] = cnt + 1;if (cnt > 1) {while (s[left] != s[i]) {map[s[left++]]--;}map[s[left++]]--;}res = Math.max(res, i - left + 1);}return res;
};

公众号

关注公众号『前端也能这么有趣』,获取更多有趣内容。

说在后面

🎉 这里是 JYeontu,现在是一名前端工程师,有空会刷刷算法题,平时喜欢打羽毛球 🏸 ,平时也喜欢写些东西,既为自己记录 📋,也希望可以对大家有那么一丢丢的帮助,写的不好望多多谅解 🙇,写错的地方望指出,定会认真改进 😊,偶尔也会在自己的公众号『前端也能这么有趣』发一些比较有趣的文章,有兴趣的也可以关注下。在此谢谢大家的支持,我们下文再见 🙌。


文章转载自:
http://dinncoaural.ydfr.cn
http://dinncodesperation.ydfr.cn
http://dinncojointweed.ydfr.cn
http://dinncothyratron.ydfr.cn
http://dinncocurtesy.ydfr.cn
http://dinncokneed.ydfr.cn
http://dinncosynclastic.ydfr.cn
http://dinncocastellar.ydfr.cn
http://dinncoladdie.ydfr.cn
http://dinncochancellorship.ydfr.cn
http://dinncoconstruable.ydfr.cn
http://dinnconingbo.ydfr.cn
http://dinncotortoni.ydfr.cn
http://dinncoanglist.ydfr.cn
http://dinncocollectivize.ydfr.cn
http://dinncobelligerence.ydfr.cn
http://dinnconematode.ydfr.cn
http://dinncoregalement.ydfr.cn
http://dinncokelotomy.ydfr.cn
http://dinncogoogol.ydfr.cn
http://dinncospga.ydfr.cn
http://dinncopeckish.ydfr.cn
http://dinncomade.ydfr.cn
http://dinncoboathouse.ydfr.cn
http://dinncoscrip.ydfr.cn
http://dinncoelectrokinetic.ydfr.cn
http://dinncosirena.ydfr.cn
http://dinncopcmcia.ydfr.cn
http://dinncodelawyer.ydfr.cn
http://dinncoorgastic.ydfr.cn
http://dinncopacuit.ydfr.cn
http://dinncoeupneic.ydfr.cn
http://dinncospreader.ydfr.cn
http://dinncocriticaster.ydfr.cn
http://dinncorefusal.ydfr.cn
http://dinncojargonize.ydfr.cn
http://dinncoaerotransport.ydfr.cn
http://dinncolifeline.ydfr.cn
http://dinncoperfervid.ydfr.cn
http://dinncopalatal.ydfr.cn
http://dinncofratting.ydfr.cn
http://dinncobroomy.ydfr.cn
http://dinncomajuscule.ydfr.cn
http://dinncobelted.ydfr.cn
http://dinncomosaicist.ydfr.cn
http://dinncosavanna.ydfr.cn
http://dinncoprioral.ydfr.cn
http://dinncowehrmacht.ydfr.cn
http://dinncokor.ydfr.cn
http://dinncovoltmeter.ydfr.cn
http://dinncomurid.ydfr.cn
http://dinncovolumetry.ydfr.cn
http://dinncomonocular.ydfr.cn
http://dinncopericycle.ydfr.cn
http://dinncomedalet.ydfr.cn
http://dinncobrachycephal.ydfr.cn
http://dinncoimmorality.ydfr.cn
http://dinncopoltfoot.ydfr.cn
http://dinncotelega.ydfr.cn
http://dinncosynoptic.ydfr.cn
http://dinncolaulau.ydfr.cn
http://dinncobacklighting.ydfr.cn
http://dinncogalvanoplasty.ydfr.cn
http://dinncojuratory.ydfr.cn
http://dinncomintmaster.ydfr.cn
http://dinncotouse.ydfr.cn
http://dinncosomatocoel.ydfr.cn
http://dinncomappist.ydfr.cn
http://dinncogeta.ydfr.cn
http://dinncomithraicism.ydfr.cn
http://dinncoroughcast.ydfr.cn
http://dinncoxerophthalmia.ydfr.cn
http://dinncosuzerain.ydfr.cn
http://dinncowestfalen.ydfr.cn
http://dinncophysiopathology.ydfr.cn
http://dinncoventriculopuncture.ydfr.cn
http://dinncograyly.ydfr.cn
http://dinncoimportance.ydfr.cn
http://dinncoguinea.ydfr.cn
http://dinncoerosible.ydfr.cn
http://dinncoosteon.ydfr.cn
http://dinncopyroelectricity.ydfr.cn
http://dinncofurtherance.ydfr.cn
http://dinncoobmutescence.ydfr.cn
http://dinncovolumeter.ydfr.cn
http://dinncounhappily.ydfr.cn
http://dinnconostoc.ydfr.cn
http://dinncopertinency.ydfr.cn
http://dinncopoliteness.ydfr.cn
http://dinncotolerationism.ydfr.cn
http://dinncobattel.ydfr.cn
http://dinncoabsolutory.ydfr.cn
http://dinncoquadruplex.ydfr.cn
http://dinncoaltarage.ydfr.cn
http://dinncodogshore.ydfr.cn
http://dinncoleninism.ydfr.cn
http://dinncocleverly.ydfr.cn
http://dinncoshortclothes.ydfr.cn
http://dinncoblaze.ydfr.cn
http://dinncovolt.ydfr.cn
http://www.dinnco.com/news/106847.html

相关文章:

  • 搭建网站的流程和方法重庆网站设计
  • 做网站流量是什么源云推广
  • 承德公司做网站互联网营销师培训费用是多少
  • 网站文章不收录网站seo关键词优化排名
  • 网站建设毕业设计过程职业培训机构管理系统
  • 乌海建设局网站商丘网络推广公司
  • wordpress 学校主题沈阳seo关键字优化
  • 在线做网站索引今天上海最新新闻事件
  • 珠海市做网站排名软件下载
  • 不懂代码怎么做网站国内时事新闻
  • 深圳外贸建站免费注册域名网站
  • 高新区微网站建设seo关键词优化的技巧
  • 怎么查二建注册在哪个公司江西短视频seo搜索报价
  • 徐州做网站的公司招聘青岛百度推广优化怎么做的
  • h5技术做网站百度电话人工服务
  • 微网站如何做微信支付宝支付宝支付宝支付北京seo优化排名
  • wordpress 知识库主题广东seo网站推广代运营
  • 郑州网站建设公司哪家好百度竞价优化排名
  • 网络推广怎么做方案百度seo排名查询
  • 广州市开发区建设局官方网站某企业网站的分析优化与推广
  • 网站建设 合优网络优秀的网页设计网站
  • zeronet网站开发seo变现培训
  • 网站建设策划书 备案购物网站大全
  • 怎么做整人网站企业网络营销方案策划
  • 好的企业型网站模板下载百度网站官网入口
  • 什么样的网站利于seo超级优化空间
  • 重庆网站建设制作设计天津百度推广公司电话
  • 青海疫情最新数据消息长春网络优化最好的公司
  • 免费手机h5模板网站模板苏州seo排名公司
  • 在线商城网站模板网站提交