func validCombinations(alphabet string, maxChar int) []string {
var result []string = []string{""}
var last, next int
for i := 1; i <= maxChar; i++ {
last = len(result)
for _, str := range result[next:] {
for _, char := range alphabet {
result = append(result, str+string(char))
}
}
next = last
}
return result
}