I am creating a program that when given a list, returns a new integer list where the first two elements remain the same, and where each element after is the median of the three elements ending in that position in the original list. For example, given the list: [1, 2, 3, 4, 5, 6, 7, 8, 9], the program would return: [1, 2, 2, 3, 4, 5, 6, 7, 8].
This is the code I've written where I'm getting the correct results, but it is failing my tester. I'm not sure if I'm missing an odd case.