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.
The string can be converted to a set directly
The string is walked through twice here, which isn't optimal in terms of time. The time complexity added is O(1) though
This comment is hidden because it contains spoiler information about the solution
Mapping
str()
onto list slices is more readable:This comment is hidden because it contains spoiler information about the solution
The for-case paradigm
There's a more concise way to do it with formatted string literals https://www.codewars.com/kata/reviews/59b1a938182024506b00081d/groups/5d211384ed0ee5000134b2e3
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Yes, you are right. Since Python 3.12,
type
is a soft keyword. Overwriting soft keywords within a scope is bad practice. However, when I wrote this code,type
wasn't a soft keyword. That's a typical problem with legacy code. :)The name
object
is already takenThere's already a callable named
type
The name
object
is already used by theobject
classThis comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Loading more items...