Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Passes the tests but doesn't solve the problem posed.
Nice idea, but it doesn't quite work.
Yes, anagrams must have equal sums, but equal sums are not necessarily anagrams.
This passed the example tests because they were inadequate to reveal the error. The following test would fail using your code:
Test.assert_equals(anagrams('add', ['ace', 'dad', 'ebb', 'fab', 'gaa']), ['dad'])
It looks like the tests are broken.
Very cool idea! Thanks.
However, I have a couple of comments:
10, 11, 12, ... 20
with (Binomial) proportions
1 : 10, : 45 : 120 : 210 : 252 : 210 : 120 : 45 : 10 : 1
therefore (%3 + 1) values 1, 2, 3 occur with proportions
1+120+210+10 : 10+210+120+1 : 45+252+45
i.e.
341 : 341 : 342
The deviation from uniformity is small, and gets smaller with larger array size.