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:
str()
map(str, n[:3])
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
The name object is already taken
object
There's already a callable named type
type
The name object is already used by the object class
An empty list shouldn't be both set as a default argument of recursive() and passed upon its first call
recursive()
Loading collection data...
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
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
An empty list shouldn't be both set as a default argument of
recursive()
and passed upon its first callLoading more items...