aboutsummaryrefslogtreecommitdiff
path: root/challenge-007/jaime/README
blob: 46e62dafa4004bcb2f6f6cc0e00a1733211748d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Solution by Jaime Corchado, (@tortsnare)[https://twitter.com/tortsnare].

#Challenge #1
Write a program which prints out all anagrams for a given word.

## Solution
Lookup anagrams in a hash of Engligh words.

The script does initialize a list of words from Webster's Second International dictionary,
 but I removed any hyphenated or capitalized words.

All words are keyed by alphabetical order. `join "", sort split //`
Words that are anagrams of one another share the same key.
Words that are not anagrams, do not share a key.

The script reports the anagrams of its arguments by looking up all words that share the key.

#Challenge #2
Write a program to find the sequence of characters that has the most.

## Solution
The English words are hashed as before.
The script tracks the key with the most additions.