7 kyu

Compress sentences

787 of 1,272mikeos
Description
Loading description...
Lists
Algorithms
  • Please sign in or sign up to leave a comment.
  • alserg Avatar

    The issue here is that Acceptance Criteria provide the wording as If a word appears more than once in the sentence, your string should return the position of the first occurrence of the word. so you tend to reference the original sentence.

    Meanwhile tests and solutions show, that the "correct" approach is to treat and refer to the 1st occurance in condensed (no repetitions) array of words, which, coincidently, is expected to have the inherited order of the initial sentense.

  • saudiGuy Avatar

    python new test framework is required. updated in this fork

  • AlexShiresRoth Avatar

    Question is too vague

  • mwave Avatar

    This comment has been hidden.

  • tbuyar Avatar

    This comment has been hidden.

  • akar-0 Avatar

    COBOL translation (author is inactive).

  • JohanJomy Avatar

    This should be a 6kyu not a 7kyu

  • Toshibis Avatar

    For test "counter pop counter counter stars" "01002"

  • Ciprian Amza Avatar

    This comment has been hidden.

  • farhanaditya Avatar

    Great kata. Learned something new. JavaScript translation kumited!

  • kingcobra Avatar

    Really cool introduction to compression. Thank you!

  • SUSREE64 Avatar

    for the following test case, my code is failing to pass: "The number 0 is such a strange number Strangely it has zero meaning"

    Not able to understand why?. Should 0 to be considered punctuaion and be ignored/removed. I have removed 0 from the sentence made a new sentence (convered all to lower case, removed space in place of 0) "the number is such a strange number strangely it has zero meaning"

    The result is as shown below. Where am I doing worng. Did I understand the kata correctly?.

    '01234517891011' should equal '012345617891011'

  • dcieslak Avatar

    Approved!

  • phantamanta44 Avatar

    Your random test cases are a little broken... You're just comparing the results of compress to itself, which is kind of bad.