Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2.
For example,
Given:
s1 = "aabcc",
s2 = "dbbca",
When s3 = "aadbbcbcac", return true.
When s3 = "aadbbbaccc", ret...
分类:
其他好文 时间:
2015-05-03 12:06:25
阅读次数:
179
You are climbing a stair case. It takes n steps to reach to the top.
Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?
此题用动太规划解决。
递归式为:dp[n] = dp[...
分类:
其他好文 时间:
2015-04-09 08:49:52
阅读次数:
104