Ad
  • Custom User Avatar

    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?

  • Custom User Avatar
  • Custom User Avatar

    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.

  • Custom User Avatar

    Oh sh*t, yeah, I see what you mean now. Thanks.

  • Custom User Avatar

    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.

  • Custom User Avatar

    I still don't get why my code's translation '@[´a' isn't correct.

  • Custom User Avatar

    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."

  • Custom User Avatar

    Why is 343**(1/3) = 6.999999999999999 in python?
    Also 503756397099**(1/5) = 219.000000000000006

  • Custom User Avatar

    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]

  • Custom User Avatar

    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.

  • Custom User Avatar

    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