6 kyu

Repeated Substring

895 of 2,062opportunity356
Description
Loading description...
Algorithms
  • Please sign in or sign up to leave a comment.
  • saudiGuy Avatar

    python new test framework + random tests are required. updated in this fork

  • narjo Avatar

    This comment has been hidden.

  • AlexDRichards Avatar

    Getting STDER error after passing all tests. Can someone explain what's up? Works in my IRB environment fine, no error throws. Also references the error on a line where only code is 'end'.

  • miguel99 Avatar

    good kata

  • laurelis24 Avatar

    Somehow solved this. Ugly code, but solved atleast. xD

  • YuraKolodiy13 Avatar

    could someone explain why it is worng

    initial string is "abcoabc"

    expected [ 'abc', 2 ] to deeply equal [ 'abcoabc', 1 ]

  • akar-0 Avatar
  • dfhwze Avatar

    Description not up to date. For every language except C, it is explained what to return.

  • trashy_incel Avatar

    C translation (author gone)

    it includes random tests

  • RNOH Avatar

    Nice kata! better to have more random tests although!

  • user9644768 Avatar

    Ruby 3.0 should be enabled.

  • willfowls Avatar

    The kata was great and I enjoyed it. I do have constructive feedback for instructions though. While you did specify in the description that the substring multiplied by a number should equal the entire string itself, that specific detail could have been more descript and/or clear. Also, including the fact that a substring can be one character is helpful. I see how it is not entirely needed though as well.

  • FArekkusu Avatar

    No random tests.

  • FArekkusu Avatar

    Python 3 should be enabled.

  • Beast Avatar

    Enter the Mind of The Beast...

  • vadviktor Avatar

    For me the description is not clear: I'd search for the shortest (minimum) substring first with an appearence highest (maximum) of the matches. Therefore in "abcabcabc" I'd find a result to be ["ab", 3], because that is the shortest substring (minimum?)

    Can anyone tell me why could I interpret this in a wrong way? Does it mean that I am not too good in Math?

  • nathan_b Avatar

    This comment has been hidden.

  • GiacomoSorbi Avatar

    Translated it into js and Ruby, so if you want to add those versions, just do it :)

    In case you feel like adding random tests or extralong strings, just let me know [preferably commenting on the translations, it seems this gives better chance of being notified] and I will fix the kumited versions accordingly :)

  • JS01 Avatar

    At the beginning, the description specifies that t should be a minimum substring. At the end, it says it should be a maximum substring.

  • Odomontois Avatar

    It would be nice to have large test cases to force linear complexity

  • opportunity356 Avatar

    Thank you for your suggestions! I've edited the description and tests. Hope I've fixed all that you had mentioned before.

  • davidbrear Avatar

    description needs to be cleaned up a bit.

  • jolaf Avatar

    It should be mentioned in description, that if two substrings have equal number of occurences, the longer string must be returned.

    And even better, if there're two or more substrings of equal length occuring the same number of time (like in abcdefdefabc), it should be specified, which of them must be returned, or the tests must be designed so that either answer would be accepted.

  • jolaf Avatar

    Typo in kata description: lowwercase

  • Unnamed Avatar

    Searching such an i that s[:i] == s[-i:] passes all the tests.