Ad
  • Custom User Avatar

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

  • Custom User Avatar

    returns true if a portion of str1 characters can be rearranged to match str2

    Where are the x of ldcxkfyrlcbdxsekl in ferzdffpubobgmilcnk ?

    B1ts, what you said doesn't matter, you can have more letters in s1.

    scramble('rkqodlw', 'world') ==> True
    
  • Custom User Avatar

    s1: ferzdffpubobgmilcnk

    s2: ldcxkfyrlcbdxsekl

    I don't see z (4th char) included in the 2nd string.

    Edit: oops, I didn't read the task correctly, it's the other way around. So, x is in s2, but not in s1, so it can't be true.

  • Default User Avatar

    I clearly don't understand the Kata, because in my Attempts, I get false positives. An example: ferzdffpubobgmilcnk and ldcxkfyrlcbdxsekl. It appears to me, that this case should return True for ek, but according to the Attempts it should return False. What am I not understanding correctly?

  • Custom User Avatar

    In Python, are my two very different algorithms too slow or could it be related to the generation of long random test cases ? Is there a way to time each ?

  • Custom User Avatar

    It's not originally a Python kata ( it's maybe easier in Haskell ). Also, rank inflation.

    That said, I can't fix it for you. Only an admin can, not even the person who approved it.

  • Custom User Avatar
  • Custom User Avatar

    I either time out but my logic is correct (checked out of CW) or I follow the hint to use s = (s % (M+1) + math.floor(s/(M+1))) % M and get an error:
    OverflowError: integer division result too large for a float

    Should we go bitwise arithmetic to solve this ? If so, not sure it is a 6kyu.

  • Custom User Avatar

    Doing it, very fun kata. I am coming to realise that a Test Driven Development approach to this one really helps, and I find it funny because I did not get what made TDD so useful until now!

  • Default User Avatar

    i dont remember when i solved something myself.. so i dont think so

  • Custom User Avatar

    I spent 10 hours+ figuring out a mathematical solution based on triangular numbers and the hint that a solution existed without iteration. Keep trying. I'm probably dumber ;-)

  • Default User Avatar

    sadly description of kata dosent help at all to solve this. and after seeing solutions it lead me to conclustion im too dumb for learning programing

  • Custom User Avatar

    What's the value of n there?

  • Custom User Avatar

    Python Test results are strange: [1,2,3,4,5,6,7 ] Expected result = 0 ?

  • Custom User Avatar
  • Loading more items...