結果 : s substring java time complexity