結果 : calculate time complexity of given code