There can be multiple ways to solve a given problem.
I have updated the code. And, now all edge cases are being taken care of. Leading spaces, trailing spaces, multiple spaces. Built-in method reverse() is replaced by implementation of reverse().
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
There can be multiple ways to solve a given problem.
I have updated the code. And, now all edge cases are being taken care of. Leading spaces, trailing spaces, multiple spaces. Built-in method reverse() is replaced by implementation of reverse().