5 kyu

[St]arting [St]ring

72 of 92carlos.vl
Description
Loading description...
Strings
  • Please sign in or sign up to leave a comment.
  • zencue Avatar

    Why the ouput ["only", "solutions", "some"] insted of ["only","some","solutions"].The test: "only some solutions are answers"

  • Szymon83 Avatar

    Why the output is ["only", "solutions", "some"] instead of ["solutions', "some"] The test: "only some solutions are answers"

    Descriptions says: Group them by their beginning!

    • dfhwze Avatar

      ONLY if their group size (or array length) is equal to the number of shared letters in each beginning

      • solutions, some -> beginning = so (2 letters, 2 words) OK
      • only -> beginning = o (1 letter, 1 word) OK
      • are -> beginning = ar (2 letters, 1 word) not OK
      • answers -> beginning = an (2 letters, 1 word) not OK
    • prynslik Avatar

      only -> beginning = o (1 letter, 1 word) OK \\\ Why 'o'? Its only one word here wtf??

      are -> beginning = ar (2 letters, 1 word) not OK \\\ Why 'ar'? Its only one word here wtf??

      answers -> beginning = an (2 letters, 1 word) not OK \\\ Why 'an'? Its only one word here wtf??

      Whats the logic here? Why dont author explain this in the description..

    • dfhwze Avatar
      • There is 1 word that starts with o -> {"o": ["only"]} -> 1 letter prefix, 1 word -> 1 = 1 -> OK
      • There are 2 words that start with a -> {"a": ["are","answers]} -> 1 letter prefix, 2 words -> 1 < 2 -> we will add more letters to make subdivisions
      • There is 1 word that starts with ar -> {"ar": ["are"]} -> 2 letters prefix, 1 word -> 2 > 1 -> Not OK
      • There is 1 word that starts with an -> {"an": ["answers"]} -> 2 letters prefix, 1 word -> 2 > 1 -> Not OK
      • There are 2 words that start with s -> {"s": ["some","solutions]} -> 1 letter prefix, 2 words -> 1 < 2 -> we will add more letters to make subdivisions
      • There are 2 words that start with so -> {"so": ["some","solutions]} -> 2 letter prefix, 2 words -> 2 = 2 -> OK
      • we take all the OK's in one final sorted array -> ["only", "solutions", "some"]
      • Mic drop!
  • dfhwze Avatar

    Python: The reference solution is really slow. If I run it against itself, I get a timeout. I don't think the ref solution should timeout.

    • carlos.vl Avatar

      Thank you for the remport, I change the ref solution (it was very slow endeed). Now it shouldn't timeout.

      Issue marked resolved by carlos.vl 2 years ago
  • sluggedlemon Avatar

    The description says to return an empty list if any cases match, I assume you meant if none of them match?

  • LanXnHn Avatar

    From the description, I don't know what should I do if nothing match...

    So in the case of 'a ab', what should I do?

    • carlos.vl Avatar

      Endeed is added on the test cases an not specify on the description. I added a note in the description, if it helps.

    • LanXnHn Avatar

      I was wondering if I don't return anything in that case or what to do from reading the description

  • Voile Avatar

    You will be given a string that contains space-separated words

    Count how many letters they share in said group

    Fixed tests contain strings which have punctuations, which are not letters. So should they be counted? I don't think such characters should exist in the test cases in the first place, when they're causing the description to contradict itself.

    • carlos.vl Avatar

      I didn't see the test cases with the punctuations, indeed there shouldn't be any of those. Now is fixed. Thanks

      Issue marked resolved by carlos.vl 2 years ago
  • Voile Avatar

    Input parameter should not be named str, it's Python's built-in.