結果 : implement recursive algorithm in python