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.
Damn, your solution taught me something new. Didn't know you can turn a list into a dictionary with .fromkeys and it's clever that since keys have to be unique it essentially removes duplicates by default.
emmm, make it matter, use for will more fast?
ok, i didnt see anything 🏃🏃
god why i didn't think for sorting it first
The task is to maintain numbers' order in the argument array, not the Natural numbers order.
lol noobs
wise
This comment is hidden because it contains spoiler information about the solution
Excuse me, what would the solution with O(N) complexity look like?
[start:stop(not but not including): step] so str(string)[::-1] gives every character of the string by step -1, thus backwards.
It's a way in Python to reverse a value, so basically it's doing a boolean evaluation (True/False) against whether the string values are the same forward and backwards, a.k.a a "Palindrome".
https://docs.python.org/3/library/functions.html#slice
Can you please explain what is [::-1] doing ?
oh dear
@AcesOfGlory:
Great explanation, thank you for all the details.
Just to correct you a little - in your code the last expression evaluates to:
[1, 2, 45, 6, 5, 4]
and not to
[1, 2, 4, 5, 6, 45]
I think you had a typo.
Loading more items...