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.
I can't even solve this with pen and paper. Am I stupid or is this a very difficult one?
Any hints to get started?
Thank you :)
Can someone explain why my code times out?
def find_uniq(arr):
a = [sorted(set(i.lower())) for i in arr]
for i in a:
if a.count(i) == 1:
return arr[a.index(i)]
Sorry, I don't know how to make indentation in a comment, but they are correct in my code.
Oh sh*t, yeah, I see what you mean now. Thanks.
Yes, that is correct, but 'z' is 12 letters from 'n'. To get to the 13th letter from 'n', the program has to go back to 'a', or the ASCII value 097. But it seems like the test wants 'n' to be '{' which has the ASCII value 123.
I still don't get why my code's translation '@[´a' isn't correct.
The random tests in python don't even substitute some of the characters. For example it says that something like 'QAnj\nf\nK(´75' should equal 'QA{j\nf\nK(´75'.
Only one of the characters is changed...
Another example is: '@[´n' should equal '@[´{'. But in a ROT13 transformation 'n' should equal 'a'.
The hint says: "For this task you're only supposed to substitue characters. Not spaces, punctuation, numbers etc."
Why is 343**(1/3) = 6.999999999999999 in python?
Also 503756397099**(1/5) = 219.000000000000006
Python. But it was my mistake. One of the tests was with a number as a string AND an integer, and I oversaw that detail.
example [1, 4, 23, "1", 123]
It is nowhere specified that the new list should contain only one occurence of each integer, yet the test doesn't allow it. Just saying.
I think it's because range takes all the numbers up to but not including the 2nd parameter.
For example:
range(1, 8) covers the numbers 1, 2, 3, 4, 5, 6, 7