Ad
  • Default User Avatar
  • Custom User Avatar

    Thanks for a fun kata. I suggest expanding the test cases since there are several half-correct solutions.

    • P is capitalized and occurs just once: "Pack my box with five dozen liquor jugs", potentially a problem for those that use an array and index using: "ch - 65"
    • First 13 letters in both upper and lower case "ABCDEFGHIJKLMabcdefghijklm"; distinct characters is 26, but it's just 13 distinct letters
    • 26 unique characters, none of which are letters "!@#$%^&*()_+1234567890-={}"
    • Take existing pangrams and make them non-pangrams by swapping out unique-non-letter characters for targetted characters. For example: pangram.Replace("a", "!")

    You could try a jumbling trick with LINQ:

    string pangram = "Pack my box with five dozen liquor jugs";
    string bar = string.Concat(foo.OrderBy(_ => random.Next()));
    // for one run: bar = "vajuwoie nfg Pdoqsx  hluiti mzroe bkc y"