[UCSD白板题] Compute the Edit Distance Between Two Strings
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的更多相关文章
- [UCSD白板题] Longest Common Subsequence of Three Sequences
Problem Introduction In this problem, your goal is to compute the length of a longest common subsequ ...
- [UCSD白板题] Primitive Calculator
Problem Introduction You are given a primitive calculator that can perform the following three opera ...
- [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 ...
- [UCSD白板题] Maximize the Value of an Arithmetic Expression
Problem Introduction In the problem, your goal is to add parentheses to a given arithmetic expressio ...
- [UCSD白板题] Take as Much Gold as Possible
Problem Introduction This problem is about implementing an algorithm for the knapsack without repeti ...
- [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 ...
- [UCSD白板题] Sorting: 3-Way Partition
Problem Introduction The goal in this problem is to redesign a given implementation of the randomize ...
- [UCSD白板题] Majority Element
Problem Introduction An element of a sequence of length \(n\) is called a majority element if it app ...
- [UCSD白板题] Binary Search
Problem Introduction In this problem, you will implemented the binary search algorithm that allows s ...
随机推荐
- JavaIO之File类
Java-IO之File类 Java-IO之File类 1. File类 1.1. File类说明 1.2. 体验 File 类 1.3. 构造一个 File 类实例: 1.4. 路径: 1.4.1. ...
- js常用正则
var sTest="xxxkdsj234dogdog1234xx"var reTest1=/(dog){2}/var reTest2 = /(?:dog){2}/;console ...
- 深受C/C 程序员欢迎的11款IDE
几十年过去了,C和C++作为主要的高级的程序设计语言,在全球范围内仍然广受欢迎,并牢牢占据着TIOBE编程语言排行榜前5名,应用程序和系统的开发离不开这两门语言,现在我们来总结一下近些年来,深受C/C ...
- 试一下SVG
用鼠标点击那个圆形试试 function changeCircle() { var c = document.getElementById("mycircle"); c.setAt ...
- linux 系统服务
此文涉及的命令:service.chkconfig. 概念 daemon 的主要分类 stand_alone:此 daemon 可以自行单独启动服务 属性:daemon 启动并加载到内存后就一直占用内 ...
- 关于Intent的七大重要属性
在Android 中,Intent用来封装两个Activity之间的调用意图,实现两个Activity之间的跳转,并传递信息. Intent的七大重要属性:ComponentName Action ...
- C# Winform学习--- 实现石头剪刀布的游戏
本文使用winform实现简单的石头剪刀布的游戏,主要实现,电脑随机出拳,玩家手动点击出拳:实现简易背景图片3秒切换:简易统计信息. 1.效果图 2.实现代码 新建一个windows窗体程序,用数字1 ...
- 简易购物车 --day2
代码段 f =float(input('输入你的工资')) goods=['1.apple','2.mac','3.ph','4.python','5.php'] price=[35,26.5,14, ...
- webstorm11怎么设置成sublime3的界面
引入架包导入即可 下载路径:https://github.com/OtaK/jetbrains-monokai-sublime
- perl 引用
数组的数组 $a = [ [1, 2, 3], [4, 5, 6], [7, 8, 9] ] 哈希的哈希 my $student_properties_of = { 'zdd' => { 'ag ...