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.
No, they are not. The string "This Kata." is not one word, so the constraint you quoted does not apply. However, width = 5, they both need to go on their own line. Since lines cannot end in a space, the words will need to be right justified.
Thank you for the clarification on line priority. Now fix the description to accurately reflect the requirement. Marking issues resolved without actually doing anything is probably the reason the Kata has dozens of "resolved" issues
Test cases expect space to be added between punctuation even when the input string doesn't have it. No mention of that functionality is present in the description.
Example ('orci.Fusce' as opposed to 'orci.','Fusce'):
Result text not equivalent to original: ['Lorem', 'ipsum', 'dolor', 'sit', 'amet,', 'consectetur', 'adipiscing', 'elit.', 'Vestibulum', 'sagittis', 'dolor', 'mauris,', 'at', 'elementum', 'ligula', 'tempor', 'eget.', 'In', 'quis', 'rhoncus', 'nunc,', 'at', 'aliquet', 'orci.Fusce', 'at', 'dolorsit', 'amet', 'felis', 'suscipit', 'tristique.', 'Nam', 'a', 'imperdiet', 'tellus.', 'Nulla', 'eu', 'vestibulum', 'urna.', 'Vivamus', 'tincidunt', 'suscipit', 'enim,', 'nec', 'ultrices', 'nisi', 'volutpat', 'ac.', 'Maecenas', 'sit', 'amet', 'lacinia', 'arcu,', 'non', 'dictum', 'justo.', 'Donec', 'sedquam', 'vel', 'risus', 'faucibus', 'euismod.', 'Suspendisse', 'rhoncus', 'rhoncus', 'felis', 'at', 'fermentum.', 'Donec', 'lorem', 'magna,', 'ultricies', 'a', 'nuncsit', 'amet,', 'blandit', 'fringilla', 'nunc.', 'In', 'vestibulum', 'velitac', 'felis', 'rhoncus', 'pellentesque.', 'Mauris', 'at', 'tellus', 'enim.', 'Aliquam', 'eleifend', 'tempus', 'dapibus.', 'Pellentesque', 'commodo,', 'nisi', 'sit', 'amet', 'hendrerit', 'fringilla,', 'ante', 'odio', 'porta', 'lacus,', 'ut', 'elementum', 'justo', 'nulla', 'et', 'dolor.'] should equal ['Lorem', 'ipsum', 'dolor', 'sit', 'amet,', 'consectetur', 'adipiscing', 'elit.', 'Vestibulum', 'sagittis', 'dolor', 'mauris,', 'at', 'elementum', 'ligula', 'tempor', 'eget.', 'In', 'quis', 'rhoncus', 'nunc,', 'at', 'aliquet', 'orci.', 'Fusce', 'at', 'dolor', 'sit', 'amet', 'felis', 'suscipit', 'tristique.', 'Nam', 'a', 'imperdiet', 'tellus.', 'Nulla', 'eu', 'vestibulum', 'urna.', 'Vivamus', 'tincidunt', 'suscipit', 'enim,', 'nec', 'ultrices', 'nisi', 'volutpat', 'ac.', 'Maecenas', 'sit', 'amet', 'lacinia', 'arcu,', 'non', 'dictum', 'justo.', 'Donec', 'sed', 'quam', 'vel', 'risus', 'faucibus', 'euismod.', 'Suspendisse', 'rhoncus', 'rhoncus', 'felis', 'at', 'fermentum.', 'Donec', 'lorem', 'magna,', 'ultricies', 'a', 'nunc', 'sit', 'amet,', 'blandit', 'fringilla', 'nunc.', 'In', 'vestibulum', 'velit', 'ac', 'felis', 'rhoncus', 'pellentesque.', 'Mauris', 'at', 'tellus', 'enim.', 'Aliquam', 'eleifend', 'tempus', 'dapibus.', 'Pellentesque', 'commodo,', 'nisi', 'sit', 'amet', 'hendrerit', 'fringilla,', 'ante', 'odio', 'porta', 'lacus,', 'ut', 'elementum', 'justo', 'nulla', 'et', 'dolor.']
The description states "Lines should end with a word not a space." However the test cases add an additional requirement that lines cant begin with a space. It is impossible to satisfy both constraints for lines that contain a single word with length less than the given width.
The constraint "Each line should contain as many words as possible." is also ambiguous. If a given text can be justified both by [2,2] and [3,1] (words on each line), there is no way to split the words such that each line contains as many words as possible.
You never define how the bag should be returned nor give an example.
This is genuinely the best kata on the website and it's sad that there aren't 100 more versions.
This seems abnormally hard for a 5. 5 seems like a good rating for a straightforward, no frills, BFS problem. This is not that.
At least for python, the default stack-overflow protection is enough to pass the infinite recursion requirement. If that's intended, I don't really see a point of even having that requirement.
That's not really relevant. The code shouldn't only work for the test cases. It should work for any valid input.
It would be nice if the requirement for number parsing wasn't buried 100 lines into the examples...
Are you sure that's what the tests are expecting? My understanding is that by returning the pointer on allocate, we allow the checker to verify correct performance without making any assumptions on the implementation of memory allocation.
For your example:
allocate(16) -> 5
allocate(16) -> 40
allocate(16) -> 22
The checker can deduce that 0-4, 21, 38-39, 56-63 are free based on the previous inputs and outputs so it would expect an error on the next allocate(16).
That is of course just my guess. If it is expecting certain implementations, that needs to be fixed.
It's unclear from the description if min_price([1,x]) should return 0 or 1
It shouldn't just be implied that any items in a store can be exactly valued by a combination of the coins. It needs to be explicitly stated or else the kata makes no sense.
Not sure I would call this best practices. Dictionary lookup seems far less expensive then the set creations needed for reduce() and only slightly more cumbersome. Still a great solution though.
This comment is hidden because it contains spoiler information about the solution
I'm not sure if the images weren't loading or if I was just blind.
Loading more items...