编程介的小学生 2017-04-03 14:48 采纳率: 20.5%
浏览 820
已采纳

Best Editor

To convert one string to another string, you can do the following operations:

  1. Back and delete a character(backspace) Move the cursor back one column and delete the character on that place.
  2. Insert a character Insert any character at the cursor's position, and the cursor moves one column forward.
  3. Overwrite a character Overwrite the character at the cursor's position with another character, and the cursor moves one column forward.
  4. Move back The cursor moves one column backward.
  5. Move forward The cursor move one column forward.

As you are the best editer, you want to minimize the number of operations. The question is to find the minimum number of operations. Assume that the cursor is at the end of the first string at the beginning.

Input

There are multiple test cases(less than 60). Each test case consists of two lines, the first line is the initial string and the second is the target string. All the input strings' length is less than or equal to 100. Proceed until the end of file.

Output

For each test case you should print exactly one line containing the answer.

Sample Input

abc
bc
abc
abcd

Sample Output

3
1

  • 写回答

1条回答 默认 最新

  • devmiao 2017-04-03 15:49
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥15 一道python难题3
  • ¥15 用matlab 设计一个不动点迭代法求解非线性方程组的代码
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler
  • ¥15 oracle集群安装出bug
  • ¥15 关于#python#的问题:自动化测试