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.
Python test cases seem to contradict themselves on duplcation. The simple test cases say we shouldn't allow duplications, ex:
[['cheese'], ['rat', 'rat', 'tar'], ['star', 'tars', 'tsar']] should equal [['cheese'], ['rat', 'tar'], ['star', 'tars', 'tsar']]
while the random tests allow lots of duplication, see the
['Mm', 'mM']
failure below[['AQipcR', 'ARciQp', 'ARicQp', 'AipcQR', 'ApcQiR', 'QcApiR', 'QpAcRi', 'QpiRcA', 'RQpAic', 'RcApiQ', 'RpiQAc', 'cARiQp', 'cRpQAi', 'pRAciQ'], ['BpUDwoj', 'BpUowjD', 'BwUDopj', 'DoBwjUp', 'DpwUjoB', 'DwoBpjU', 'UpjwoDB', 'UwjopBD', 'jBUwDop', 'oUwDjBp', 'opBjUwD', 'opjUBDw', 'pUjwoBD', 'pjDBoUw', 'pjowUDB', 'poBUjwD', 'wUBjoDp', 'wUjBDpo'], ['BwUDopj', 'DUpBwoj', 'pUjwoBD'], ['CiboySMp', 'MoCpibSy', 'MpSboiCy', 'bCMyiopS', 'ipboySCM', 'oCiSpybM', 'oiMbSpCy', 'oypbCiSM', 'pCMyiobS', 'yiCpoMbS', 'yoCMSibp', 'ypCSbMio'], ['FPcusOuzT', 'FPsOuzTcu', 'FczuTusPO', 'OuPucFszT', 'OuuczFTsP', 'PFOuzucsT', 'PuTFucOzs', 'cFOTPuzsu', 'cTuzuPOFs', 'csuuzTFPO', 'sFuPzuTOc', 'uPOFTczsu', 'uzuFOPcTs', 'zOcFsTuPu', 'zcsPuFOuT'], ['Mm', 'mM']]
should equal
[['AQipcR', 'ARciQp', 'ARicQp', 'AipcQR', 'ApcQiR', 'QcApiR', 'QpAcRi', 'QpiRcA', 'RQpAic', 'RcApiQ', 'RpiQAc', 'cARiQp', 'cRpQAi', 'pRAciQ'], ['BpUDwoj', 'BpUowjD', 'BwUDopj', 'DUpBwoj', 'DoBwjUp', 'DpwUjoB', 'DwoBpjU', 'UpjwoDB', 'UwjopBD', 'jBUwDop', 'oUwDjBp', 'opBjUwD', 'opjUBDw', 'pUjwoBD', 'pjDBoUw', 'pjowUDB', 'poBUjwD', 'wUBjoDp', 'wUjBDpo'], ['CiboySMp', 'MoCpibSy', 'MpSboiCy', 'bCMyiopS', 'ipboySCM', 'oCiSpybM', 'oiMbSpCy', 'oypbCiSM', 'pCMyiobS', 'yiCpoMbS', 'yoCMSibp', 'ypCSbMio'], ['FPcusOuzT', 'FPsOuzTcu', 'FczuTusPO', 'OuPucFszT', 'OuuczFTsP', 'PFOuzucsT', 'PuTFucOzs', 'cFOTPuzsu', 'cTuzuPOFs', 'csuuzTFPO', 'sFuPzuTOc', 'uPOFTczsu', 'uzuFOPcTs', 'zOcFsTuPu', 'zcsPuFOuT'], ['Mm', 'Mm', 'Mm', 'Mm', 'Mm', 'Mm', 'Mm', 'Mm', 'mM', 'mM', 'mM', 'mM', 'mM', 'mM', 'mM', 'mM', 'mM', 'mM', 'mM', 'mM']]
wow now thats efficient! I solved it in 40 lines
Fixed.
Fixed.
Cool kata, but there is critical flaw in edge cases tests, where we asserts that
["aaA", "Aaa", "aaa"] equals [["aaA", "Aaa"], ["aaa"]].
It is wrong, the right answer should be [["aaA", "Aaa", "aaa"]], because anagrams are case insensitive by its nature, referring to related Wikipedia article https://en.wikipedia.org/wiki/Anagram :
"Listen" is valid anagram for "Silent" vice versa, despite that 'l' and 's' letters have different cases in both words.
Same is relevant for these examples as well:
"New York Times" = "monkeys write"
"Church of Scientology" = "rich-chosen goofy cult"
"McDonald's restaurants" = "Uncle Sam's standard rot"
and more on. Please fix that test case!
Approved.
D translation
Go translation
Rust translation
Python translation
JS: one random test is not enough, and it is a weak one (though not considering the issue raised by farhanaditya below).
You can't, because
assert.deepEqual([1,2], [2,1])
will fail.It's 2021 where Node 12 shoud be enabled and
assertSimilarUnsorted
in preloaded should be removed and replaced withassert.deepEquals
The shuffle function is broken. It generates the same string every time.
Loading more items...