首页 > 其他 > 详细

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

时间:2017-07-10 10:01:29      阅读:309      评论:0      收藏:0      [点我收藏+]

 

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 两个字符串的删除操作

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!