看板 Prob_Solve 關於我們 聯絡資訊
※ 引述《eight0 (一直到今天)》之銘言: : ※ 引述《RockLee (Now of all times)》之銘言: : 原始網址: : http://www.careercup.com/question?id=14539805 : 題目: : Three strings say A, B, C are given to you. : Check weather 3rd string is interleaved from string A and B. : Ex: A="abcd" B="xyz" C="axybczd". answer is yes. o(n) 首先感謝你的貢獻. 不過這個 Code 似乎有問題, 我用了一個試了一下 test("aaaaa", "aaaabbbb", "aaaaabbbbaaaa"); 答案是 false, 明顯的, 你的 Code 有問題. 我認為你 DP 只查前兩個字元, 一長就 fail 了 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 76.170.76.183
eight0:果然是這邊嗎...中午時就是覺得相異字元相同時怪怪的 05/14 21:14