結果 : naive string matching algorithm time and space complexity