Problem Introduction

The edit distinct between two strings is the minimum number of insertions, deletions and mismatches in an alignment of two strings.

Problem Description

Task.The goal of this problem is to implement the algorithm for computing the edit distance between two strings.

Input Format.Each of the two lines of the input contains a string consisting of lower case latin letters.

Constraints.The length of both strings is at least 1 and at mot 100.

Output Format.Output the edit distance between the given two string.

Sample 1.
Input:

ab
ab

Output:

0

Sample 2
Input:

short
ports

Output:

3

Sample 3
Input:

editing
distance

Output:

5

Solution

[UCSD白板题] Compute the Edit Distance Between Two Strings的更多相关文章

  1. [UCSD白板题] Longest Common Subsequence of Three Sequences

    Problem Introduction In this problem, your goal is to compute the length of a longest common subsequ ...

  2. [UCSD白板题] Primitive Calculator

    Problem Introduction You are given a primitive calculator that can perform the following three opera ...

  3. [UCSD白板题] Points and Segments

    Problem Introduction The goal in this problem is given a set of segments on a line and a set of poin ...

  4. [UCSD白板题] Maximize the Value of an Arithmetic Expression

    Problem Introduction In the problem, your goal is to add parentheses to a given arithmetic expressio ...

  5. [UCSD白板题] Take as Much Gold as Possible

    Problem Introduction This problem is about implementing an algorithm for the knapsack without repeti ...

  6. [UCSD白板题] Number of Inversions

    Problem Introduction An inversion of a sequence \(a_0,a_1,\cdots,a_{n-1}\) is a pair of indices \(0 ...

  7. [UCSD白板题] Sorting: 3-Way Partition

    Problem Introduction The goal in this problem is to redesign a given implementation of the randomize ...

  8. [UCSD白板题] Majority Element

    Problem Introduction An element of a sequence of length \(n\) is called a majority element if it app ...

  9. [UCSD白板题] Binary Search

    Problem Introduction In this problem, you will implemented the binary search algorithm that allows s ...

随机推荐

  1. eclipse maven spring mvc el表达式无效

    http://www.myexception.cn/javascript/2031310.html

  2. ubuntu 安装mysql-python和 python-ldap,navicate 问题

    1.Ubuntu 下 pip install mysql-python 报错 EnvironmentError: mysql_config not found 原因是缺少mysqlclient 包,执 ...

  3. task9暂存

    <h6>第一组项目</h6> <div class="wrap"> <div class="title"> &l ...

  4. 【转】mysql存储引擎

    http://www.cnblogs.com/kevingrace/p/5685355.html Mysql有两种存储引擎:InnoDB与Myisam,下表是两种引擎的简单对比   MyISAM In ...

  5. VS2008设置断点不命中

    网上试了各种办法都不好使,最后想到要修复一下,其实只要重置一下开发环境就好了,具体方法如下: 开始 --> Microsoft Visual Studio 2008 --> Visual ...

  6. javascript (js)判断手机号码中国移动、中国联通、中国电信

    我国使用的手机号码为11位,其中各段有不同的编码方向:前3位———网络识别号:第4-7位———地区编码:第8-11位———用户号码. 中国移动134.135.136.137.138.139.150.1 ...

  7. python 传参open

    # Author:mologa k = "ab" for i in k: with open('%s.txt'%i,'w') as f: f.write("hello&q ...

  8. 用SQLMAP工具进行SQL注入

    1.检查注入点 [注入点需要自己寻找,可以利用一些工具,例如:Acunetix Web Vulnerability scanner (WVS),AppScan等]u表示URL. sqlmap   -  ...

  9. 激活windows10 LTSB 2016

    激活windows10 LTSB 2016 slmgr /ipk DCPHK-NFMTC-H88MJ-PFHPY-QJ4BJ slmgr /skms kms.firadio.net slmgr /at ...

  10. ABAP 字符串操作

    1).SHIFT:截断字符串 SHIFT {c} [BY {n} PLACES] [{mode}].: 作用:去掉字符串的前n个位置的字符,如果n未指定,默认为1,如果指定的n小于等于0,则字符串不变 ...