Write a function ReverseString that takes a string and returns the string reversed.
func ReverseString(s string) string- A single line containing a string
s.
- The reversed string.
0 <= len(s) <= 1000- The string may contain ASCII letters, digits, and special characters.
hello
olleh
Go is fun!
!nuf si oG
- Fork the repository.
- Clone your fork to your local machine.
- Create a directory named after your GitHub username inside
challenge-2/submissions/. - Copy the
solution-template.gofile into your submission directory. - Implement the
ReverseStringfunction. - Test your solution locally by running the test file.
- Commit and push your code to your fork.
- Create a pull request to submit your solution.
-
Initialize Go Module (if not already initialized):
Navigate to the
challenge-2directory:cd challenge-2 go mod init challenge2 -
Run the Tests:
go test -v