1062. Longest Repeating Substring
實際上這題跟 718 差不多, 差別在於因為要找的是 repeat sunstring, 所以我們立刻可以想到一樣用兩個字串來比較看看, 這樣就跟 718 題目變的一樣了, 要找的是 longest common substring(subarray)
但稍微有點不一樣, 也就是兩個字串在同一個位置上不能視為 common (看題目的意思可以了解
DP
T: O(n^2)
S: O(n^2)
Last updated
實際上這題跟 718 差不多, 差別在於因為要找的是 repeat sunstring, 所以我們立刻可以想到一樣用兩個字串來比較看看, 這樣就跟 718 題目變的一樣了, 要找的是 longest common substring(subarray)
但稍微有點不一樣, 也就是兩個字串在同一個位置上不能視為 common (看題目的意思可以了解
T: O(n^2)
S: O(n^2)
Last updated