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.
Don't get what you want to say?
This solution does not work correctly. If we use the option [1].sameStructureAs([1]), it will return false.
It's really nice to see what I could have done better. For one, it's clever that you made the function itself recursive, I created a new recursive function. Also, interesting to see how you return false if they aren't the same length which seems so obvious but went over my head.
Thanks for the example case, I think I misread the if/else logic the first time round. Much appreciated!
This is for this case
Test.expect(![1,1].sameStructureAs([[2,2],2]), "[1,1] not same as [[2,2],2]");
without the else your solution returns true
This comment is hidden because it contains spoiler information about the solution
In the description the example shows that the motto is lower case but the tests expects them how where provided.