Ad
  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    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 string str, find if str follows the same sequence as pattern.

    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

  • Custom User Avatar

    Haha I see it now. Thanks for your patience!

  • Custom User Avatar

    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.

  • Custom User Avatar

    I was working through the ruby version. If you need more info than that let me know what you need.

  • Custom User Avatar

    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.

  • Default User Avatar

    It's still confusing. I used

    n.to_i    
    

    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.