Ad
  • Custom User Avatar

    You shouldn't use parentheses without a purpose

  • Custom User Avatar

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

  • Default User Avatar

    Sure. I have changed the description and examples to reflect your suggestions. Thanks for your contribution!

  • 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

  • Default User Avatar

    Hi ecocode

    There is only one number test and that is in the Initial Tests section. For the random tests, all the strings are chars.

  • Default User Avatar

    hello and thanks for this kata, i am enjoying it BUT!! i keep failing one test. Is it possible for the pattern to contain at least one element that is a number greater than 9?
    Thank you.

  • 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.

  • Default User Avatar

    I need to know why you think your solution should pass. Why is your solution returning false? For pattern abba and str car truck truck car, you can see that a = car and b = truck. So a(car)b(truck)b(truck)a(car). Your solution should return true

  • Custom User Avatar

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

  • Default User Avatar

    I need more info than that man.

  • 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.