Two words are friends if they have a Levenshtein distance of 1. That is, you can add, remove, or substitute exactly one letter in word X to create word Y. A word’s social network consists of all of its friends, plus all of their friends, and all of their friends’ friends, and so on.
Write a program in your favorite dynamic language that efficiently finds the social network for any given word, using the word list provided.
Please email your completed program to email@example.com