I have added spoiler tags around your code since it is a working solution and we don’t want to spoil it for those who have not worked on this challenge yet.
There are many ways to do this challenge.
Using the reverse method is a popular approach but using a for loop like the OP just did is a perfectly valid approach to.
As long as the OP understands the logic of the problem and understands what went wrong with their initial approach, that is the real goal of these challenges.