Complete the following method:
● public static Map<String,ArrayList<String>> loadEditMap(String filename). This method reads a collection of words, all of the same length, and returns an
“edit map” for the words. In the map, each word (key) is associated with an ArrayList (value) containing all the other words that different from it by exactly one character (an edit distance of one). Each word in the file will therefore appear in the map once as a key and possibly in the ArrayLists associated with several other words. For example, the small set of words “bank”, “roof”, “sand”, “sank” and “tank” would produce the map:
“bank” → [“sank”, “tank”]
“roof” → []
“sand” → [“sank”]
“sank” → [“bank”, “sand”, “tank”]
“tank” → [“bank”, “sank”]