結果 : log n time complexity algorithm