
坐标DP
文章平均质量分 66
益达915
一名在读大学生,渣渣一枚,进取中...
展开
-
最小编辑距离 | Minimum Edit Distance
关于两个字符串s1,s2的差别,可以通过计算他们的最小编辑距离来决定。 设A、B为两个字符串,狭义的编辑距离定义为把A转换成B需要的最少删除(删除A中一个字符)、插入(在A中插入一个字符)和替换(把A中的某个字符替换成另一个字符)的次数,用ED(A,B)来表示。直观来说,两个串互相转换需要经过的步骤越多,差异越大。对于编辑距离的状态转移较为难想。 正确的思路应当是将s1的前i位数据转换成s2的前原创 2016-08-22 22:05:21 · 1776 阅读 · 0 评论 -
LeetCode | Triangle
Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given the following triangle [ [2], [3,4], [6,5,原创 2016-08-22 23:15:46 · 275 阅读 · 0 评论 -
LeetCode | Dungeon Game
The demons had captured the princess (P) and imprisoned her in the bottom-right corner of a dungeon. The dungeon consists of M x N rooms laid out in a 2D grid. Our valiant knight (K) was initially p原创 2016-08-26 18:03:12 · 528 阅读 · 0 评论