Skip to content

Instantly share code, notes, and snippets.

View wafisher's full-sized avatar

Will Fisher wafisher

View GitHub Profile

Missing Letters

The sentence "A quick brown fox jumps over the lazy dog" contains every single letter in the alphabet. Such sentences are called pangrams.

You are to write a method getMissingLetters(), which takes as input a String containing a sentence and returns all the letters not present at all in the sentence (i.e. the letters that prevent it from being a pangram).

You should ignore the case of the letters in sentence, and your return should be all lowercase letters, in alphabetical order. You should also ignore all non-alphabet characters as well as all non-US-ASCII characters. Imagine that the method you write will be called many thousands of times in rapid succession on strings with length ranging from 0 to 50.

Accordingly, you should try to write code that runs as quickly as possible. Also, imagine the case when the input string is quite large (e.g., tens of megabytes). See if you can develop an algorithm that handles this case efficiently while still running very quickly on smaller i

hexdump -C /dev/urandom | GREP_COLOR='1;32' grep --color=auto 'ca fe'