S&P Global interview question

reverse a list