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.
This comment is hidden because it contains spoiler information about the solution
Would you be interested in some edited language in the descriptions so other's don't make the same mistake as I did? For example: given a
pattern
and a stringstr
, find ifstr
follows the same sequence aspattern
.The examples, as written, can be taken two different ways also, so maybe something like:
word_pattern('abab', 'truck car truck car') == true
word_pattern('aaaa', 'dog dog dog dog') == true
word_pattern('abab', 'apple banana banana apple') == false
word_pattern('aaaa', 'cat cat dog cat') == false
Haha I see it now. Thanks for your patience!
Ok I must be completely mistaken about how the kata should be working. I thought the string should include the letter in the pattern? Truck does not include the letter b. In the other examples this holds true and is what I was trying to achieve.
I was working through the ruby version. If you need more info than that let me know what you need.
This is one of the test cases:
Test.assert_equals(word_pattern('abba', 'car truck truck car'), true)
I was wondering why I kept failing the tests.
It's still confusing. I used
and most test cases passed, integer or not, but the random input test cases failed. I can just change the code based on your comment above but still don't understand what's expected.