Nice Kata, but for a 1-Kyu level the requirements for the optimization (pass2) could be stricter.
Eg most of the soltions submitted will reduce ((1 + 3) + x) to (4 + x), but additional cases that should be achievable are:
This comment is hidden because it contains spoiler information about the solution
What do you mean "short-cut"? Which language?
It is possible to solve this kata using short-cut, with one additional step.
I have genuinely enjoyed this kata. Thank you.
We need a simple test that a non-array element in the first is not the same as an array in the second.
Test.expect( ![1,1].same_structure_as([2,[2,2]]), "[1,1] not same as [2,[2,2]]")
Yes you are right, so if there is no nesting structure at all, it should return True
yes, its the same with my code
but the lenght is the same...its a problem with this specific test...its an issue.
No, there is no nested structure in the second one. That's a number and two strings, see the quotes there?
I dont understand. basic test:
False, "[1,[1,1]] not same as [[2,2],2]"
[1,'[',']'] same as ['[',']',1]: False should equal True
First case same as second, but kata expects different result? it should be both False...or both True...
"Testing to see if you tried a certain short-cut" - I thought using short-cuts is the main idea of Python
Tests should use test.assertEquals instead of test.expect.
not an issue.
only the last digit can be 'X'.