nambar12 / anagrams

Anagrams challange

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Anagrams Matcher

Your task is to create a program which finds anagrams within a given input.

Anagram definition

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.

Challenge

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.

Examples

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

Checking the program

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

About

Anagrams challange


Languages

Language:Python 96.6%Language:Shell 2.7%Language:Batchfile 0.7%