Anagram
면접 대비시간 제한4초메모리 제한256 MB
단어 목록에서 앞서 등장한 단어의 애너그램인 단어를 제거하고 원래 순서를 유지해 출력한다.
문제
Two words are anagrams if the letters of the first word can be reordered to obtain the second one. An instance of anagrams is the pair “listen” and “silent”.
You are given a list of words, each word consisting of lowercase letters. Your goal is to filter this list by dropping any word whose anagram has already appeared earlier on the list.
입력
The first line contains , the length of the list. This is followed by lines, each containing one word.
출력
Print out the list of words without anagrams, one word per line. The words should appear in the same order as given in the input.
제한
- All letters are lowercase letters of the English alphabet.
- Length of any word will not exceed .