I finally got it! This kata had been a thorn sticking in my side for at least a year now. I just couldn't seem to logic it out. Today I stopped thinking and just stared at the "cute" and "not cute" patterns in the test cases (after printing them out all pretty) and let my visual cortex ponder it for a bit.
Now, to go tackle that goddamned "What's the flag?" kata....
Thanks, I learnt about unpack and
zip()
through your code.chef's kiss. I didn't know you could rotate arrays like that. My solution was much more brute-forcey :)
Thanks! It is confusing but you explain it clearly!
No, it is actually more confusing than that!
The first time array.pop(0) is executed the array variable is still bound to the input argument.
But after that, the array variable is rebound to a new list, and therefore no longer mutates the input argument.
So, the input array is changed after the function, but only with its first row removed.
This comment is hidden because it contains spoiler information about the solution
incredible view! thank you!
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
why?
duplicate issue
The link to the image is dead - this makes the kata essentially a guess and check puzzle
thank you for making me discover the zip function
Thank you! Good work!
I finally got it! This kata had been a thorn sticking in my side for at least a year now. I just couldn't seem to logic it out. Today I stopped thinking and just stared at the "cute" and "not cute" patterns in the test cases (after printing them out all pretty) and let my visual cortex ponder it for a bit.
Now, to go tackle that goddamned "What's the flag?" kata....
thank you, your scritp so good
Loading more items...