Write Python code to test the algorithm.
Write Python code to test the algorithm.