Do you understand that you're comparing NESTING STRUCTURE, right? Read the description again if not. You're not comparing data types.
Complete the function/method (depending on the language) to return true/True when its argument is an array that has the same nesting structures and same corresponding length of nested arrays as the first array.
It doesn't say anything about each element datatype matching. You can think of the list elements like list and not a list (it doesn't matter which datatype is) if you want.
[1,'[',']'] same as ['[',']',1]
[nal,nal,nal] same as [nal,nal,nal] nal: not a list
[1,[1,1]] not same as [[2,2],2]
[nal,list] not same as [list,nal] not the same
The nesting structure is the same, not a kata issue. The data type doesn't matter, unless it is a list, because they can be nested, unlike the other data types.
ok thanks
Do you understand that you're comparing NESTING STRUCTURE, right? Read the description again if not. You're not comparing data types.
It doesn't say anything about each element datatype matching. You can think of the list elements like list and not a list (it doesn't matter which datatype is) if you want.
not the same INT is not equal STR.
The nesting structure is the same, not a kata issue. The data type doesn't matter, unless it is a list, because they can be nested, unlike the other data types.
Test that is wrong:
Test :
Testing to see if you tried a certain short-cut
[1,'[',']'] same as ['[',']',1]: False should equal True
3 elements but the first is INT and the first in the second is STR then is False not True
in the example test
test.assert_equals(same_structure_as([1,[1,1]],[[2,2],2]), False, "[1,[1,1]] not same as [[2,2],2]")
2 elements but the first id INT and the first in the second is LIST then is False
Boy did I over think this one lol
my code is the same, hahhaha great
that is a new list great.