Skip to content

Latest commit

 

History

History
14 lines (12 loc) · 704 Bytes

README.md

File metadata and controls

14 lines (12 loc) · 704 Bytes

Anagrams You are given a list of N words (strings containing only lower case letters of the English alphabet). We consider two words to be equivalent if they contain the same letters, i.e. we can rearrange the letters of one word in order to obtain the other word. Compute the size of the largest subset of equivalent words. Desired solution You should assume the input is quite large (there are about 10^5 letters in total).

Standard input The first line contains a single integer value N. Each of the following N lines contains a single string, representing one of the words.

Standard output The output should contain a single integer representing the size of the largest subset of equivalent words.