結果 : explain the algorithm and flowchart with example