Retired

Word Patterns (retired)

246 of 785joh_pot
Description
Loading description...
Algorithms
  • Please sign in or sign up to leave a comment.
  • hobovsky Avatar

    This kata is a subject to deduplication process here: https://github.com/codewars/content-issues/issues/104.
    Please join the discussion to share your opinions, and help us identify duplicate kata and retire them.

  • R3CEPT0R Avatar

    This comment has been hidden.

  • user9644768 Avatar

    Ruby 3.0 should be enabled, see this to learn how to do it

  • user9644768 Avatar

    Please use new python test framework.

  • akar-0 Avatar

    The example pattern= 'abba', string= 'dog dog dog dog' => False expected is clearly abusive in view of the description.

  • FArekkusu Avatar

    Python 3 should be enabled.

  • FArekkusu Avatar

    It's not mentioned that each letter in the pattern stands for a distinct word.

  • BeliOrel Avatar

    Great kata but description is lacking some info which cannot be comprehended by given examples alone (in current state they are somehow misleading). It should be stated that string can contain various number of words and that words can be mapped into whichever possible character in the pattern.

  • docgunthrop Avatar

    passed all the example test cases, and, upon hitting submit, I'm getting 75 passed, 1 failed. Is there any way to get info on the failed test case? The failed case result I'm getting back just says "Let us get started".

  • docgunthrop Avatar

    This comment has been hidden.

  • user4231100 Avatar
    Testing using pattern = kbwvqjsbmmffgvuwgufpsaxtsl
    Testing using str = eqtrshyjjtsp iointhxehgh iointhxehgh sabwpqgpmc dgsjqgdbdyei vmuxnykxfpa qxlivelmpc yrdwkqxasuk uaoxdkovcc eqtrshyjjtsp ovqlliagitro axssdlkiimri bsvgvucofjlk vmuxnykxfpa kdynecsytgvu jennftinraa ppqtrpnrpv nfgmdbkxgf vmuxnykxfpa kdynecsytgvu vwapwiuacno ppqtrpnrpv bsvgvucofjlk sabwpqgpmc nfgmdbkxgf nfgmdbkxgf
    

    Returned false but was expecting true for c# - I believe this is an error, the first three don't match.

    Testing using pattern = kbw
    Testing using str = eqtrshyjjtsp iointhxehgh iointhxehgh
    
  • obolensky Avatar

    in Javascript 10th test looks like

    Test.assertEquals(wordPattern('aafggiilp', 'cow cow fly pig pig sheep sheep chicken aardvark'), true);
    

    it's wrong
    please fix it

  • Stanislav.Dolg Avatar

    Hello! Thanks for the kata. It is really interesting. But i keep failing 11th test...just 11th...can U show me the parametrs of it? or some hint)

  • oosij Avatar

    Can you advise parameters for last random test? I'm failing to pass only the last random test and want to see what the parameters are so that I can check and edit my code.

  • bkaes Avatar

    The description should state that all pattern characters need to have another word, e.g.

    wordPattern('abba', 'dog dog dog dog') === false
    

    (In other words, say that the pattern mapping has to be injective)

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

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

  • zebulan Avatar

    I like this kata, thanks @joh_pot!

    My only (minor) issue is the description. I think it would be more helpful to add an example of the input/output to the description.

    word_pattern('abab', 'apple banana apple banana') == True
    
  • GiacomoSorbi Avatar

    Upvoted, ranked, translated: enjoy and let me know if you approve them, so that I can edit the description :)