Ad
  • Custom User Avatar

    GetPossibleStrings() is an IEnumerable, but under the surface it returns a list.
    It's somewhat a combination of two different worlds.
    The main function Possibilities() has to call ToList() because of that.
    Two routes that might have been a bit cleaner:

    1. Let GetPossibleStrings() return List directly,
      since that's already what is built in the method body and what is required
      as the return value.

    2. Make GetPossibleString() a real IEnumerable generator function, by
      making use of "yield return ...". This prevents the creation of intermediate
      lists when recursing. I followed this route in my own code, so if you want
      an example of this, take a look there.

    Kind regards,
    Maurice