码迷,mamicode.com
首页 > 其他好文 > 详细

[LeetCode] Delete Operation for Two Strings 两个字符串的删除操作

时间:2017-07-10 10:34:14      阅读:202      评论:0      收藏:0      [点我收藏+]

标签:tco   cas   required   pre   code   sam   string   cte   nat   

 

Given two words word1 and word2, find the minimum number of steps required to make word1 and word2 the same, where in each step you can delete one character in either string.

Example 1:

Input: "sea", "eat"
Output: 2
Explanation: You need one step to make "sea" to "ea" and another step to make "eat" to "ea".

 

Note:

  1. The length of given words won‘t exceed 500.
  2. Characters in given words can only be lower-case letters.

 

s

 

[LeetCode] Delete Operation for Two Strings 两个字符串的删除操作

标签:tco   cas   required   pre   code   sam   string   cte   nat   

原文地址:http://www.cnblogs.com/grandyang/p/7144045.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!