Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Just keep in mind the following:
Nice. I've seen the chained comparators with inequalities, but not equalities. Now that I see it, it's obvious that it would work. Just never thought of it before.
Does this map avoid recursion? If so, clever and practical idea!
Indeed that is a common pitfall.
I am surprised noone mentioned it before, thank you!
This comment is hidden because it contains spoiler information about the solution
You're welcome ;-)
I had the same problem but it finally worked out. good job lechevalier,thanks, I am learning new things.
same_structure_as([1,'[',']'],['[',']',1])
returns True in Python 3.6 and Python 3.8 - the versions available on CW.No reason to return anything else in other Python versions.
Hi, the same_structure_as([1,'[',']'],['[',']',1]) results to a False when I use your solution.
Python 3.7.3
The sturcture of these two arrays is actually the same. ']' is equivalent of a symbol or any non-list structure, so basically both original and other are equiv to [1, 1, 1]
Hi there,
I know that this is not a tested case, but have you tried with these values: original = [1, '[', ']'] and other = ['[', ']', 2]. Your solution returns True, but these strings are a bit diferent, so I suppose that it should return False... Am I wrong?