摘要:
This is a classic problem of Dynamic Programming. We define the statedp[i][j]to be the minimum number of operations to convertword1[0..i - 1]toword2[0... 阅读全文
摘要:
The idea to solve this problem is to first sort the intervals according to theirstartfield and then scan the intervals from head to tail and merge tho... 阅读全文
摘要:
A classic subroutine of merge sort. Just merge the elements from back to forth. Keep a pointer for the merged position of the element and two other po... 阅读全文
摘要:
The typical solution to this problem is to use Dynamic Programming. The state dp[i] represents whether s[0..i - 1] can be broken into words in wordDic... 阅读全文
摘要:
This link suggests a concise C++ recursive solution. The original code may be hard to understand at first and I have rewritten the code below. You may... 阅读全文