July 2017
Intermediate to advanced
284 pages
6h 45m
English
All right, we’re looking to construct paths, and paths contain steps, so how about starting with the step operation? We want this operation to take a word and return all of the valid words that are reachable in one step from that word. For example, from “lead” we want to get the list
| | ["bead","dead","head","mead","read","load","lend","lewd", |
| | "leaf","leak","leal","lean","leap","lear","leas"] |
and we want it to exclude non-words like “xead.”
A key idea in functional programming is to split big problems into smaller ones. We use it all the time. So how can we apply it here?
At some point we probably need to use the dictionary to filter out invalid words like “xead,” but does the filtering need to be tied into the word ...
Read now
Unlock full access