The first line contains a single integer N the number of English words in the dictionary -
Question:
The first line contains a single integer N the number of English words in the dictionary - followed by N dictionary entries. Each entry is contained on a separate line, which contains first the English word, then a hyphen surrounded by spaces and then comma-separated list with the translations of this English word in Latin. All the words consist only of lowercase English letters. The translations are sorted in lexicographical order. The order of English words in the dictionary is also lexicographic.
Print the corresponding Latin-English dictionary in the same format. In particular, the first word line should be the lexicographically minimal translation of the Latin word, then second in that order, etc. The English words inside each line should also be sorted lexicographically.
Example input:
3 apple - malum, pomum, popula fruit - baca, bacca, popum punishment - malum, multa
Example output:
7 baca - fruit bacca - fruit malum - apple, punishment multa - punishment pomum - apple popula - apple popum - fruit
Has to be done in Java and has to use HashMaps
Artificial Intelligence Structures And Strategies For Complex Problem Solving
ISBN: 9780321545893
6th Edition
Authors: George Luger