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.
Went a similar route, but this is considerably shorter! nice job! :)
This comment is hidden because it contains spoiler information about the solution
I still do not understand what shoul i do, i seems that i have problem with this (The restriction is that the characters in part1 and part2 should be in the same order as in s), but in the second test they are not in the same order as in s and it shows 'True'. Can smb explain to me?
Please use appropriate markdown formatting when posting code. See https://docs.codewars.com/training/troubleshooting#post-discourse.
See https://docs.codewars.com/training/training-example#debugging-a-kata and https://docs.codewars.com/training/troubleshooting#print-input.
This comment is hidden because it contains spoiler information about the solution
d | other
(cf. https://docs.python.org/3/library/stdtypes.html#mapping-types-dict)
cool..
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
I'm always looking for a way to use reduce and for the most obvious reduction challenges, its my goto, but I need to study this more to wrap my head around what's happening here. This takes reduction to a new level. I'd really like to use this pattern once I understand it.
This comment is hidden because it contains spoiler information about the solution
You are sorting a list containing strings and ints.
<
only works on operands of the same type (unlike e.g. in JavaScript where everything is compared as string by default)as a beginer can say that this kata is still hard to those who can solve 4,5 kyu
key=lambda a: (len(a), a) is the sort key, he sorts based on the length of the string first and then on the string itself that means the default sort key when sorting strings (alphabetically)
As the task wants you to start with the longest names and proceed to the shortest and also sort from z-a in case of same length he uses reverse=True to reverse the sort order on both keys
multiply_all([1,2,3])(2)
Loading more items...