結果 : hardest algorithm to implement