Ad
  • Default User Avatar
    validWord(['x','ts','sqx','xtgk','xupq','qy','qyv','x','oow','owy','tvbf','ux','xewuxte','xtewx','xk','f','o','y','pmusqa','sqamq','qvw','wz','zwfa','farx'], 'xtsqxtgkxupqyqyvxoowytvbf')
    

    x, ts, xtgk, xupq, qy, qyv, x, oow, y, tvbf

  • Default User Avatar

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

  • Custom User Avatar

    полностью согласен)
    тесты нормально проходят, а потом начинается свистопляска

  • Custom User Avatar

    ye, надо других тянуть за собой)

  • Default User Avatar

    О, а вот и ты с rss)

  • Custom User Avatar

    Такое чувство, будто кейсы писали , ударив кота головой об клаву..)

  • Default User Avatar

    'ab' + 'bc' does not equal 'abc', while 'a' + 'bc' does.

  • Custom User Avatar

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

  • Default User Avatar

    yeah actually i removed l from the outer loop though it had no effect and m just accumulates the words that are present in the dictionary
    but for cases like

    valid_word(['a', 'bgkol', 'a', 'k'],'aakbgkolbgkol')
    valid_word(['ab', 'a', 'bc'],'abc')
    

    it isn't working!

  • Custom User Avatar
    l=0
    for o in range(0,len(word)-l):
      
      ...
    
      l += 1
    

    What you are doing with l has no effect on the for loop, in case you are relying on that somehow. You might as well write for o in range(0, len(word)):...
    Also, m just keeps accumulating letters without discrimination. In the end it will simply be a concatenation of the input sequence.

  • Default User Avatar

    this is the code above
    its not passing for test cases like these:

    print(valid_word(['a', 'bgkol', 'a', 'k'],'aakbgkolbgkol'))
    print(valid_word(['ab', 'a', 'bc'],'abc'))
    

    kindly review it Thanks!

  • Custom User Avatar

    Please use the spoiler tag if you are going to post solution code (even non-working) in the discourse.
    Also, if you decide to post code, use markdown formatting:

    ```

    your code

    ```

    Otherwise, we can't make heads or tails from what you wrote (indentation matters in python).

  • Default User Avatar

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

  • Default User Avatar

    also faced this problem. 1 test fails. Not clear logic of kata. Nobody can answer?

  • Custom User Avatar

    done (hopefully without me putting more mistakes in the random tests...)

  • Loading more items...