Created
December 29, 2016 07:53
-
-
Save cipepser/2bb8c732a7892380679b0d89c75104a0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
) | |
func AltnativeConnect(s1, s2 string) string { | |
// len(s1) = len(s2) | |
t := make([]rune, len(s1) + len(s2)) | |
r1 := []rune(s1) | |
r2 := []rune(s2) | |
for i := 0; i < len(r2); i++ { | |
t[2 * i] = r1[i] | |
t[2 * i + 1] = r2[i] | |
} | |
return string(t) | |
} | |
func main() { | |
var s1, s2 string = "パトカー", "タクシー" | |
fmt.Println(AltnativeConnect(s1, s2)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment