Write a function `ReverseSecondHalf()` that takes a string as an argument and prints the second half reversed. If the length of the string is odd, round it up.
Write a function that takes a `string` as an argument and prints the second half reversed. If the length of the string is odd, round it up.
- Prints the second half reversed followed by newline `\n`.
- Print the second half reversed followed by newline `\n`.
- If the string is empty, return `Invalid Output`.
- If the string's length equals one, return it, followed by newline `\n`.
@ -11,12 +11,13 @@ Write a function `ReverseSecondHalf()` that takes a string as an argument and pr
```go
func ReverseSecondHalf(str string) string {
}
```
### Usage
Here is a possible program to test your function:
Here is a possible program to test your function:
```go
package main
@ -24,18 +25,18 @@ package main
import "fmt"
func main() {
fmt.Print(ReverseSecondHalf("This is the 1st half This is the 2nd half"))
fmt.Print(ReverseSecondHalf(""))
fmt.Print(ReverseSecondHalf("Hello World"))
fmt.Print(ReverseSecondHalf("This is the 1st half This is the 2nd half"))