Please describe the bug below and include any steps to reproduce the bug or screenshots if possible.
Test Case 2 expected output is incorrect. The last element returned should be 4, not 8.
8, 5, 4, 2
8, 5, 4, 3, 2 -> 8, 5, 3, 2 [4]
8, 5, 5, 3, 2 -> 8, 5, 3, 2 [5]
10, 8, 5, 3, 2 -> 10, 8, 3, 2 [5]
10, 9, 8, 3, 2 -> 10, 9, 3, 2 [8]
10, 9, 4, 3, 2 -> 10, 9, 3, 2 [4]