結果 : java substring function time complexity