Your task is to create a program which finds anagrams within a given input.
Two strings are considered anagrams. if they have the same letters with different permutations. For example: "abbcdef" and "fedcbab" are anagrams. They should be of the same length and each letter should show up identical number of times in each of the strings.
The challenge is to write a program which gets as an input a series of strings and output the number of anagrams within this series. The input is not sorted and strings can be of any size. The program's runtime should be as short as possible. The programs should read the input strings from its standard input and output the number or anagrams to its standard output. It can be written in any language, as long as it follows the specific contract.
for the following input:
abc
abcd
abdc
acb
the program output should be:
2
for the following input:
abc
acb
bac
the program output should be:
1
The checker.py script tests the programs with several sets of input data and prints out the result. A smaple solver is provided in this repository.
Run it with: checker.py sample_solver