Ad
  • Default User Avatar

    You definitely don't need var mychars = dna.ToCharArray(); as doing a .Select in a string will already use IEnumerable. I think it's better to not use Select and loop using for or a foreach loop and use TryGetValue and check if the method returns true or false. That way, you won't get an exception if the char isn't on your mapping dictionary! :)

  • Default User Avatar

    No, you don't need it. Trying to loop a string or use a Select method will always use IEnumerable, since a string is made of a list of char.

  • Default User Avatar

    One letter not available in the dictionary and it will crash lol, should've added try catch to always be safe.