Ad
  • Custom User Avatar

    .lower() works in this case ???

  • Default User Avatar

    ALWAYS

    unless

    ...so?

  • Default User Avatar

    Can you explain why such an alarmist statement?
    Python default stack depth is 1000.
    Here the program has a logarithmic complexity -
    Meaning you will hit a RecursionError only if n > 2 ** 1000,
    which is freaking huge!

    Moreover recursion can be unavoidable in some cases:
    Not all programs can be written as an iterative function,
    and even more recursive programs require a stack -
    which may be very tedious to maintain by hand.

  • Custom User Avatar

    lol, not really , sometimes a code does not have to pass for everything and that may end up defeating the purpose of the code

  • Default User Avatar

    The description says you need to check for 'good' or 'bad' ideas. That's it. No capitalization, no upper case, no binary, no ASCII, nothing like that. That's the source of the downvotes. If you had to check for other ways good or bad might be written in, then the kata would be different and harder.

  • Custom User Avatar

    The statistics module doesn't accept non-positive (zero and negative numbers). It also performs operation on floats and doesn't guarantee exact results. See here.

  • Custom User Avatar

    Great, but don't forget using spoiler flag next time. Your post was visible in the homepage.

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    This doesn't happen in the tests, so I guess we don't have to support that.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Yes, that's right. Because this solution was written in Python 2. In Py2 filter() returned different thing. In this case, it returned a string.

  • Default User Avatar

    It's not permutations, though the effect may seem very similar. It's only shifting. You just move 1st letter to the end of the string until you get the same string you started with. ..Yet nobody will explain anything to you in simple words here. Some advanced users, the one you've just addressed on top of them, made this forum a circle of mutual admiration and contempt to all with skills beneath theirs. This website stopped serving its purpose long ago.

  • Custom User Avatar

    There're 4 unique strings which can be obtained by rotating "12341234" and they are all present in the input array. Your "problem" lies in the fact that you did not understand the task and implemented a completely wrong algorithm - the only real issue here is your solution passing the tests.

  • Loading more items...