I’m trying to create an algorithm in C# which produces the following output strings:
AAAA AAAB AAAC ...and so on... ZZZX ZZZY ZZZZ
What is the best way to accomplish this?
public static IEnumerable<string> GetWords() { //Perform algorithm yield return word; }
well, if the length is a constant 4, then this would handle it:
if the length is a parameter, this recursive solution would handle it: