|
|
|
@ -1,12 +1,12 @@
|
|
|
|
|
# ThirdTimeIsACharm |
|
|
|
|
#thirdtimeisacharm |
|
|
|
|
|
|
|
|
|
### Instructions |
|
|
|
|
|
|
|
|
|
Write a function `ThirdTimeIsACharm()` that takes a string and returns another string with every third character. |
|
|
|
|
Write a function `ThirdTimeIsACharm` that takes a string and returns another string with every third character. |
|
|
|
|
|
|
|
|
|
- Prints the Output followed by newline `\n`. |
|
|
|
|
- If the string is empty, return newline `\n`. |
|
|
|
|
- If there is no third character, return `\n` |
|
|
|
|
- If there is no third character, return newline `\n. |
|
|
|
|
|
|
|
|
|
### Expected function |
|
|
|
|
|
|
|
|
@ -17,14 +17,12 @@ func ThirdTimeIsACharm(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 |
|
|
|
|
|
|
|
|
|
import ( |
|
|
|
|
"fmt" |
|
|
|
|
) |
|
|
|
|
import "fmt" |
|
|
|
|
|
|
|
|
|
func main() { |
|
|
|
|
fmt.Print(ThirdTimeIsACharm("123456789")) |
|
|
|
|