Created
February 5, 2018 17:01
-
-
Save eloff/eb730e1cf6156c6aa73987b46e04484d to your computer and use it in GitHub Desktop.
This file contains hidden or 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 main() { | |
fmt.Println(subset([]string{"test1", "test2", "test2"}, []string{"test1", "test2"})) | |
} | |
// subset determines if the first slice of strings is a subset of the second slice of strings | |
// Examples: | |
// Input: []string{"test1", "test2", "test2"}, []string{"test1", "test2"} | |
// Output: true | |
// | |
// Input: []string{"test4"}, []string{"test1", "test2"} | |
// Output: false | |
func subset(first, second []string) bool { | |
return false // TODO | |
} |
This file contains hidden or 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" | |
"unicode" | |
) | |
func main() { | |
fmt.Println(toTitleCase("this is a string")) | |
} | |
// toTitleCase returns the input string with the first letter of each word converted to upper case | |
// Input: "this is a string" | |
// Output: "This Is A String" | |
// Works on any unicode string. | |
func toTitleCase(s string) string { | |
return s // TODO | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment