• Custom User Avatar

    this is five lists: [[0, 0, 0, 1], [1, None, 0, 1], [0, 1, 1, 1], [1, 1, 1, 1]]
    this copies one list cluster[:]
    meaning that the other four are still the same ones

    if the tests are showing the list after having allowed you to mutate it then that's not great because it can cause confusing messages that don't add up. buut you're also somewhat deserving of confusion if doing mutation where mutation isn't explicitly what is asked for.

  • Custom User Avatar
    the word is: soar
    
    Bob   matches soar to boar
    Alice matches boar to bear
    Bob   matches bear to near
    Alice matches near to neat
    Bob   matches neat to peat
    Alice matches peat to plat
    Bob   matches plat to plan
    Alice matches plan to clan
    Bob   matches clan to clap
    Alice matches clap to flap
    Bob   matches flap to ... nothing
    
    (so Alice wins)
    
  • Custom User Avatar

    I didn't realize that. Thank you for pointing that out.

  • Custom User Avatar

    It is inherated from C language on which Python interpreter is based on.

  • Custom User Avatar

    It could be any number larger than 4.

  • Custom User Avatar

    The kata asks you to minimize the "total" traveling distance for potential students, not the "individual" travelling distance for individual students.

  • Custom User Avatar

    That is no issue...

  • Custom User Avatar

    Corrected

  • Custom User Avatar

    I assume you were putting some tag in " has won the fight."

    Spelling fixed, thanks.

  • Custom User Avatar

    You can use console.log() for sneaking in...;)

  • Custom User Avatar

    Did you manage to find out? I'm facing the same problem.

  • Custom User Avatar

    This is as intended. It's meant to immitate similar instructions on real hardware. For example, consider the operation PUSHA (as part of the X86 instruction) set. It pushes registers in order

    EAX, ECX, EDX, EBX, ESP, EBP, ESI, EDI

    Whereas its corresponding restore instruction POPA pops registers in order

    EDI, ESI, EBP, ESP, EBX, EDX, ECX, EAX

    This way, a PUSHA will save all general registers to the stack, and a subsequent POPA will restore them in the exact order they were in previously.

  • Custom User Avatar

    Yeah had the same issue. So I just flipped the popr and poprr methods...

    Currently it looks like this:

    stack: push 1, push 2, push 3, push 4

    popr: pop from stack -> d, pop from stack -> c, pop from stack -> b, pop from stack -> a

    -> a = 1, b = 2, c = 3, d = 4

    poprr: pop from stack -> a, pop from stack -> b, pop from stack -> c, pop from stack -> d

    -> a = 4, b = 3, c = 2, d = 1

    So with popr "in order" means that the registers A -> D are filled the same way the values where pushed onto the stack. With poprr it's in reverse. (That's what I get from this at least)

  • Custom User Avatar

    Fixed. Thanks!

  • Custom User Avatar

    My solution passes every test I can come up with, including tests for special characters and empty Strings, yet it still fails finalSearchTestRareCases and finalSearchTestNonChar. I wish the instructions gave some indication of what cases are covered by those tests.

  • Loading more items...