Pastebin
API
tools
faq
paste
Login
Sign up
SHARE
TWEET
combine_anagrams
jctt
Feb 21st, 2013
61
0
Never
Add comment
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!
Ruby
0.18 KB
| None
|
0
0
raw
download
clone
embed
print
report
def
combine_anagrams
(
words
)
h =
Hash
[
words.
map
{
|
x
|
[
x.
downcase
.
chars
.
sort
.
join
,
Array
.
new
]
}
]
words.
each
{
|
x
|
h
[
x.
downcase
.
chars
.
sort
.
join
]
.
push
(
x
)
}
return
h.
values
end
Advertisement
Add Comment
Please,
Sign In
to add comment
Public Pastes
I earned $19,000 with this method
1 min ago | 0.29 KB
Earn $$ on trading
CSS | 15 min ago | 0.29 KB
Crypto Exchange Profits
28 min ago | 0.29 KB
Free money using older build [1.3]
41 min ago | 0.29 KB
✅ Changelly Exploit
CSS | 54 min ago | 0.29 KB
biplas v34 - Market storage and live weather...
3 hours ago | 2.55 KB
biplas v32 - Colonies and late Town Halls
3 hours ago | 4.12 KB
biplas v28 - faster render and Road routing a...
3 hours ago | 2.22 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the
Cookies Policy
.
OK, I Understand
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!