So how do we do it? Well, it turns out that the program is rather straight forward. You need something something that will loop through a file, reading in a line at a time. Racket's (in-lines) makes this all sorts of easy. So we'll start with that:

It's generalized over the original problem to any required letters and any given word length. The only at all sneaky part here is using the #:when conditional to first check if the word is the proper length. If so, use andmap to make sure all of the letters are in the word in turn. The advantage of this is that andmap will short circuit, stopping as soon as we find a letter not in the word. It'll only save us a bit of time, but over the length of of the entire dictionary, the savings can be impressive.

Likewise, the string-contains? function will short circuit, using a trick with call/cc to simulate return which I've used before: