28. Implement strStr()
1.問題
實作strStr, 若找不到則回傳 -1
2.想法
提問
function header, parameter
test input
說明想法
當碰到相同字母時, 讓計數器增加
當不同字母時, 索引值就是減去計數器
測試計算複雜度: O(n)
3.程式碼
Last updated
實作strStr, 若找不到則回傳 -1
提問
function header, parameter
test input
說明想法
當碰到相同字母時, 讓計數器增加
當不同字母時, 索引值就是減去計數器
測試計算複雜度: O(n)
Last updated