Skip to content

Instantly share code, notes, and snippets.

@eloff
Created February 5, 2018 17:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eloff/eb730e1cf6156c6aa73987b46e04484d to your computer and use it in GitHub Desktop.
Save eloff/eb730e1cf6156c6aa73987b46e04484d to your computer and use it in GitHub Desktop.
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
}
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