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.
This comment is hidden because it contains spoiler information about the solution
If you want to use sorted for shortness at least save 'sorted(arr)' in a variable instead to sort two times the same array.
This is just a list comprehension with string interpolation inside a join call, it is perfectly readable.
This comment is hidden because it contains spoiler information about the solution
The 'upper' call on 'decode' method is redundant cause the encoded text, by definition, is always in capital letters. The 'maketrans' function's result would be better to be saved as an object attribute so you don't recalculate the same on every 'encode'/'decode' calls.
This comment is hidden because it contains spoiler information about the solution
'f' from 'friend' probably.
This comment is hidden because it contains spoiler information about the solution
This is not necessary here cause integers are inmutable on Python, you can't change integers but only change references to new ones wich only would take effect on the list you are doing so, that is only necessary when you are working with mutable objects.
Nevermind.
The solution is optimal cause solution is always O(n) cause you have to iterate the whole array in every case for checking each value if it is string or int.
This solutions is actually better than type checking each value cause the 'int' function already does a type check, in the case the argument is an int, it just return itself whithout doing any operation.
Actually your solution is worse cause you are doing 2 type checkings instead of one, you are using try/catch in a loop wich is terrible slow, you are usign an extra array that consumes more memory which is not necesary, you are iterating the extra array making '2n + C' operations instead the 'n + C' from the best solution...
This comment is hidden because it contains spoiler information about the solution
The task is to maintain numbers' order in the argument array, not the Natural numbers order.
Insteat of 'continue' you should use 'elif' in this case, less lines and it is more standard.
In Python in "Model with all fields being optional", on the 5th test I got a "Validation should pass: ValidationError()". and the field that is giving me problems has default None and blank False with None as initial, isn't this supose to throw validation error?
Loading more items...