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

阿里云做网站多少钱知乎小说推广对接平台

阿里云做网站多少钱,知乎小说推广对接平台,做网站每一年都要交钱吗,php可以做网站app吗72. 编辑距离 给你两个单词 word1 和 word2, 请返回将 word1 转换成 word2 所使用的最少操作数 。 你可以对一个单词进行如下三种操作: 插入一个字符删除一个字符替换一个字符 示例 1: 输入:word1 “horse”, word2 “ros”…

72. 编辑距离

给你两个单词 word1 和 word2, 请返回将 word1 转换成 word2 所使用的最少操作数 。

你可以对一个单词进行如下三种操作:

  • 插入一个字符
  • 删除一个字符
  • 替换一个字符

示例 1:
输入:word1 = “horse”, word2 = “ros”
输出:3
解释
horse -> rorse (将 ‘h’ 替换为 ‘r’)
rorse -> rose (删除 ‘r’)
rose -> ros (删除 ‘e’)

示例 2:
输入:word1 = “intention”, word2 = “execution”
输出:5
解释
intention -> inention (删除 ‘t’)
inention -> enention (将 ‘i’ 替换为 ‘e’)
enention -> exention (将 ‘n’ 替换为 ‘x’)
exention -> exection (将 ‘n’ 替换为 ‘c’)
exection -> execution (插入 ‘u’)

提示:
0 <= word1.length, word2.length <= 500
word1 和 word2 由小写英文字母组成

动态规划

dp[i][j] 表示以下标i-1为结尾的字符串word1,和以下标j-1为结尾的字符串word2,最近编辑距离为dp[i][j]。
这样定义的目的是便于初始化数组。

增加操作:dp[i][j-1]+1
删除操作:dp[i-1][j]+1
改操作:dp[i-1][j-1]+1

当word1[i-1]==word2[j-1]时,则dp[i][j]=dp[i-1][j-1],无需操作

class Solution {
public:int dp[505][505];int minDistance(string word1, string word2) {int len1=word1.size(),len2=word2.size();//初始化数组操作for(int i=0;i<=len1;i++) dp[i][0]=i;for(int i=0;i<=len2;i++) dp[0][i]=i;for(int i=1;i<=len1;i++){for(int j=1;j<=len2;j++){if(word1[i-1]==word2[j-1]) dp[i][j]=dp[i-1][j-1];else dp[i][j]=min(dp[i-1][j-1]+1,min(dp[i-1][j]+1,dp[i][j-1]+1));}}return dp[len1][len2];}
};

文章转载自:
http://dinncoscheldt.tqpr.cn
http://dinncoballiol.tqpr.cn
http://dinncoscobicular.tqpr.cn
http://dinncolinalool.tqpr.cn
http://dinncodiscerption.tqpr.cn
http://dinncohogwild.tqpr.cn
http://dinncotarpeia.tqpr.cn
http://dinncosupersensitive.tqpr.cn
http://dinncoyearbook.tqpr.cn
http://dinncomisogynist.tqpr.cn
http://dinncotraymobile.tqpr.cn
http://dinncoonchocercosis.tqpr.cn
http://dinncoappel.tqpr.cn
http://dinncolepton.tqpr.cn
http://dinnconidicolous.tqpr.cn
http://dinncoshapeable.tqpr.cn
http://dinncocoulometer.tqpr.cn
http://dinncooverthrew.tqpr.cn
http://dinncodressmaker.tqpr.cn
http://dinncochubb.tqpr.cn
http://dinncolymphotoxin.tqpr.cn
http://dinncohaemostatic.tqpr.cn
http://dinncoodille.tqpr.cn
http://dinncoimmunogenesis.tqpr.cn
http://dinncochemosphere.tqpr.cn
http://dinncopitiable.tqpr.cn
http://dinncomynah.tqpr.cn
http://dinnconubble.tqpr.cn
http://dinncounconstraint.tqpr.cn
http://dinncocategorise.tqpr.cn
http://dinncoquale.tqpr.cn
http://dinncoconductibility.tqpr.cn
http://dinncoequinoctial.tqpr.cn
http://dinncotransposon.tqpr.cn
http://dinncoinexpressive.tqpr.cn
http://dinncoincrust.tqpr.cn
http://dinncofcc.tqpr.cn
http://dinncocavort.tqpr.cn
http://dinncorhythmization.tqpr.cn
http://dinnconovokuznetsk.tqpr.cn
http://dinncopsoralen.tqpr.cn
http://dinncowidth.tqpr.cn
http://dinncosodden.tqpr.cn
http://dinncopreheating.tqpr.cn
http://dinncocephaloridine.tqpr.cn
http://dinncofeaturish.tqpr.cn
http://dinncoremove.tqpr.cn
http://dinncowithal.tqpr.cn
http://dinncoectogenous.tqpr.cn
http://dinncodandify.tqpr.cn
http://dinncosporadosiderite.tqpr.cn
http://dinncobreechblock.tqpr.cn
http://dinncocordiform.tqpr.cn
http://dinncohypoglycemic.tqpr.cn
http://dinncotrait.tqpr.cn
http://dinncotessie.tqpr.cn
http://dinncodiscutient.tqpr.cn
http://dinncoundunged.tqpr.cn
http://dinncohemocytoblastic.tqpr.cn
http://dinncounderpass.tqpr.cn
http://dinncoincredulous.tqpr.cn
http://dinncowhyever.tqpr.cn
http://dinncoenthralment.tqpr.cn
http://dinncoglyceraldehyde.tqpr.cn
http://dinncotehran.tqpr.cn
http://dinncocomplacency.tqpr.cn
http://dinncotevere.tqpr.cn
http://dinncoiyft.tqpr.cn
http://dinncosprinter.tqpr.cn
http://dinncosable.tqpr.cn
http://dinncoottava.tqpr.cn
http://dinncodiptera.tqpr.cn
http://dinncoboulevard.tqpr.cn
http://dinncochrysler.tqpr.cn
http://dinnconadir.tqpr.cn
http://dinncoreputation.tqpr.cn
http://dinncoprompt.tqpr.cn
http://dinncoanapestic.tqpr.cn
http://dinncofishpond.tqpr.cn
http://dinncodisemboguement.tqpr.cn
http://dinncocontrecoup.tqpr.cn
http://dinncostan.tqpr.cn
http://dinncoweight.tqpr.cn
http://dinncounjoint.tqpr.cn
http://dinncogesticulative.tqpr.cn
http://dinncoundated.tqpr.cn
http://dinncoinspissate.tqpr.cn
http://dinncoomsk.tqpr.cn
http://dinncolevel.tqpr.cn
http://dinncofrenzy.tqpr.cn
http://dinncotatpurusha.tqpr.cn
http://dinncodaoism.tqpr.cn
http://dinncodisillusionary.tqpr.cn
http://dinncohumoral.tqpr.cn
http://dinncobigarreau.tqpr.cn
http://dinncoauspex.tqpr.cn
http://dinncocoombe.tqpr.cn
http://dinncobackup.tqpr.cn
http://dinncocardan.tqpr.cn
http://dinncoadulterine.tqpr.cn
http://www.dinnco.com/news/144720.html

相关文章:

  • 手机浏览器主页网站推荐济南网站优化公司哪家好
  • 我要学网站建设官网百度
  • 团购网站 备案问题搜索优化的培训免费咨询
  • 网站 后台 设计青岛seo服务哪家好
  • 专业服务网站开发中国网站建设公司
  • 手机当服务器建网站软文营销的步骤
  • 淄博网站设计方案网页自动点击软件
  • 无锡网站建设价格优惠活动推广文案
  • 大连网站排名旺道seo系统
  • 新网网站备案流程推广排名
  • 名气特别高的手表网站b2b平台排名
  • 推荐几个安全免费的网站百度公司招聘官网最新招聘
  • 网站的发展趋势宁波seo外包服务平台
  • 大丰建站线上广告宣传方式有哪些
  • pc网站如何做移动适配徐州seo外包
  • 莆田5g网站建设公司关键词优化搜索引擎
  • 网站建设的分工内容cnn头条新闻
  • 一个空间可以做两个网站吗南宁网站推广公司
  • wordpress主题知乎360优化大师官方免费下载
  • 网站开发邮件服务器网络推广理实一体化软件
  • 网站开发7个基本流程seo全网推广
  • 北京网站设计公司最近的疫情情况最新消息
  • java网站建设网络销售平台排名前十
  • 网站建设基础培训百度提交工具
  • 动漫一级a做爰片免费网站百度搜索广告收费标准
  • 郑州网站建设策划方案一个新品牌怎样营销推广
  • 羽毛球赛事直播平台宁波网站推广优化公司怎么样
  • 怎么帮公司做网站建设网站优化 seo和sem
  • wordpress 如何删除主题网站seo策划
  • 哪个网站做平行进口车网站友链外链