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.
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.
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)
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.
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.
I didn't realize that. Thank you for pointing that out.
It is inherated from C language on which Python interpreter is based on.
It could be any number larger than 4.
The kata asks you to minimize the "total" traveling distance for potential students, not the "individual" travelling distance for individual students.
That is no issue...
Corrected
I assume you were putting some tag in " has won the fight."
Spelling fixed, thanks.
You can use
console.log()
for sneaking in...;)Did you manage to find out? I'm facing the same problem.
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.
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)
Fixed. Thanks!
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...