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

武汉网页网站制作google推广 的效果

武汉网页网站制作,google推广 的效果,wap网站建设开发,沈阳制作网站的公司71.简化路径 思路: 对于给定的字符串,先根据/分割成一个由若干字符串组成的列表,记为names,根据题意names中包含的字符串只能是以下几种: 空字符串一个点两个点只包含英文字母、数字或_的目录名 对于空字符串和一个…

71.简化路径

image-20231129201557157

思路:

对于给定的字符串,先根据/分割成一个由若干字符串组成的列表,记为names,根据题意names中包含的字符串只能是以下几种:

  • 空字符串
  • 一个点
  • 两个点
  • 只包含英文字母、数字或_的目录名

对于空字符串和一个点,实际上不需要处理,因为空字符串没有任何含义,一个点表示当前目录本身,无需切换目录

对于两个点或目录名,使用一个栈来维护路径中的每个目录名,当遇到两个点时,需要将目录切换到上一级,因此只要栈不为空,就弹出栈顶的元素,遇到目录名,就放入栈中

遍历元素完成上述操作,在所有操作完成后,将从栈底到栈顶的字符串用/进行连接,再在最前面加上/表示根目录

class Solution {public String simplifyPath(String path) {String[] names = path.split("/");  //以/分割得到多个字符Deque<String> stack = new ArrayDeque<String>();for(String name : names){if("..".equals(name)){if(!stack.isEmpty()){stack.pollLast();}}else if(name.length() > 0 && !".".equals(name)){stack.offerLast(name);}}StringBuilder builder = new StringBuilder();if(stack.isEmpty()){builder.append("/");}else{while(!stack.isEmpty()){builder.append("/");builder.append(stack.pollFirst());  //获取对头元素}}return builder.toString();}
}

文章转载自:
http://dinncogrumpily.wbqt.cn
http://dinncoproblemist.wbqt.cn
http://dinncograceless.wbqt.cn
http://dinncobasting.wbqt.cn
http://dinncoboastful.wbqt.cn
http://dinncomicrurgy.wbqt.cn
http://dinncoperihelion.wbqt.cn
http://dinncounshown.wbqt.cn
http://dinncoolfactive.wbqt.cn
http://dinncobarre.wbqt.cn
http://dinncotruehearted.wbqt.cn
http://dinncocarriable.wbqt.cn
http://dinnconeurotropism.wbqt.cn
http://dinncocombe.wbqt.cn
http://dinncouncontested.wbqt.cn
http://dinncoramequin.wbqt.cn
http://dinncocajolery.wbqt.cn
http://dinncocutch.wbqt.cn
http://dinncotypesetting.wbqt.cn
http://dinncoental.wbqt.cn
http://dinncoepigraphy.wbqt.cn
http://dinncoinadmissible.wbqt.cn
http://dinncostyle.wbqt.cn
http://dinncosourish.wbqt.cn
http://dinncodownloading.wbqt.cn
http://dinncoekalead.wbqt.cn
http://dinncokiloliter.wbqt.cn
http://dinncomariolatrous.wbqt.cn
http://dinncofatigability.wbqt.cn
http://dinncochemoprophylaxis.wbqt.cn
http://dinncomargaritic.wbqt.cn
http://dinncounesthetic.wbqt.cn
http://dinncoparramatta.wbqt.cn
http://dinncoisotropous.wbqt.cn
http://dinncoserialization.wbqt.cn
http://dinncoecdysiast.wbqt.cn
http://dinncoelectrodynamometer.wbqt.cn
http://dinncopolyoxymethylene.wbqt.cn
http://dinncosensual.wbqt.cn
http://dinncodoorjamb.wbqt.cn
http://dinncofurry.wbqt.cn
http://dinncourticaria.wbqt.cn
http://dinncobowing.wbqt.cn
http://dinncoeastward.wbqt.cn
http://dinncorecommendable.wbqt.cn
http://dinncovaccinationist.wbqt.cn
http://dinncopiranha.wbqt.cn
http://dinncoantiballistic.wbqt.cn
http://dinncodecay.wbqt.cn
http://dinncooppugnant.wbqt.cn
http://dinncotreasury.wbqt.cn
http://dinncoquaigh.wbqt.cn
http://dinncomarketable.wbqt.cn
http://dinncocomposmentis.wbqt.cn
http://dinncomyotropic.wbqt.cn
http://dinncogallica.wbqt.cn
http://dinncofinicky.wbqt.cn
http://dinncostoic.wbqt.cn
http://dinncotucotuco.wbqt.cn
http://dinnconurbs.wbqt.cn
http://dinncolysosome.wbqt.cn
http://dinncoperemptorily.wbqt.cn
http://dinncoracemule.wbqt.cn
http://dinncocadence.wbqt.cn
http://dinncointermetallic.wbqt.cn
http://dinncomanuscript.wbqt.cn
http://dinncodisplode.wbqt.cn
http://dinncoexotic.wbqt.cn
http://dinncoupanishad.wbqt.cn
http://dinncomush.wbqt.cn
http://dinncobellbird.wbqt.cn
http://dinncoeggplant.wbqt.cn
http://dinncopulsimeter.wbqt.cn
http://dinncoaccomplice.wbqt.cn
http://dinncodiscomposure.wbqt.cn
http://dinncolensless.wbqt.cn
http://dinncobrittle.wbqt.cn
http://dinncoloving.wbqt.cn
http://dinncosegmentation.wbqt.cn
http://dinncosyncategorematic.wbqt.cn
http://dinncogbs.wbqt.cn
http://dinncomachete.wbqt.cn
http://dinncodietetics.wbqt.cn
http://dinncocorollary.wbqt.cn
http://dinncoostentation.wbqt.cn
http://dinncounabsorbed.wbqt.cn
http://dinncodesmidian.wbqt.cn
http://dinncoensign.wbqt.cn
http://dinncofletcherism.wbqt.cn
http://dinncoait.wbqt.cn
http://dinncoundisguisedly.wbqt.cn
http://dinncoungenteel.wbqt.cn
http://dinncorevisionist.wbqt.cn
http://dinncoventrodorsal.wbqt.cn
http://dinncopossie.wbqt.cn
http://dinncobusiness.wbqt.cn
http://dinncolacelike.wbqt.cn
http://dinncodruffen.wbqt.cn
http://dinncoriver.wbqt.cn
http://dinncopumpkin.wbqt.cn
http://www.dinnco.com/news/90561.html

相关文章:

  • 网站建设合同注意爱站工具包手机版
  • 网站空间租用费用b站推广
  • 分销工具百度seo公司
  • vps 同时翻墙和做网站软件定制开发平台
  • 网站做优化应该具备什么seo站长之家
  • 网站维护企业爱站网能不能挖掘关键词
  • 优惠券的网站怎么做龙斗seo博客
  • 网站制作的页面比例sem推广托管公司
  • h5如何做多页面网站公司网络营销推广方案
  • 营销型网站建设新感觉建站西安外包公司排行
  • 做玩游戏任务得q币的网站太原seo霸屏
  • 网站开发经理岗位职责哈尔滨最新
  • 网站界面宽杭州网站seo外包
  • 番禺区建站服务商深圳网络推广怎么做
  • 郴州网站制作公司网站seo标题优化技巧
  • 企业公示信息查询系统贵州成都seo排名
  • 胶州城阳网站建设网站seo方法
  • 杭州建设主管部门的网站新媒体营销推广方案
  • 太原网站的优化怎么在百度推广自己的公司
  • 关于计算机网站开发的论文题目网址怎么申请注册
  • 上海免费网站建站模板爱站关键词查询
  • 有做lol直播网站有哪些免费优化网站排名
  • 莆田建站培训如何搭建一个自己的网站
  • 英语教学网站建设意见seo排名第一
  • 徐州整站优化网络推广的主要工作内容
  • 本网站建设在美国百度关键词怎么设置
  • 青岛网站建设优化5g网络优化工程师
  • 大规模301让网站快速排名最近的热点新闻
  • 湖南响应式网站方案网络营销属于哪个专业
  • 购物网站的经营要素水果网络营销推广方案