Ad
  • Custom User Avatar
  • Custom User Avatar

    Very polite explanation tx

  • Custom User Avatar

    Closing now.

  • Custom User Avatar

    OK, how's this description now?

  • Custom User Avatar

    Alternatively, I could input and output multisets. That would be better technically, but the LC specification would be nigh on impossible. Lists are so much nicer to work with.

  • Custom User Avatar

    Clever idea, but I'd rather not do that. It makes output too unreadable.

  • Custom User Avatar

    You can always ask for the set of indices of the elements instead, that's always going to be a set by definition.

  • Custom User Avatar

    And if I don't change the requirements, the middle part of that could become

    The subset must consist of unique ( by index ) list elements. If a particular value occurs more than once in the input list, you can use it up to as many times as it occurs. The empty subset ..

    The first and last part don't change.

    Would that be as clear as what you wrote? Or does "subset" cause difficulty that "subsequence" does not? I can imagine "subsequence" more intuitively conveys you cannot reuse elements by index.

  • Custom User Avatar

    I can make it a requirement. Makes testing simpler even.

    But what would the description then have to be? It's about the description, ultimately.

  • Custom User Avatar

    Should I ask for a subsequence instead of a subset? I expect everybody will return one anyway, and it might make the description easier to rewrite.

    Half the problem is difference between mathematical definitions and their encoding as programming language constructs. Set and String can both be encoded as lists ( or arrays, or vectors, or sequences, or even Python tuples ).

  • Custom User Avatar

    Well, you asked about the title, so that's why I gave the wiki link there to address the title.

    About the description, I do believe the wording for the result can be fixed yeah. Giving the wiki page link is not an option though since they list the algorithms that can be used to solve this.

  • Custom User Avatar

    I don't want to use the word "sublist"; I'm afraid that would make things worse. But I'm open to changing the description; this was the best I could come up with but I wasn't entirely happy with it myself.

    The technical term is "subsequence". That does not have to be contiguous, as opposed to "substring" ( though both imply ordering ) - but "substring" is another word I definitely don't want to use because while mathematicians think a string is a list and a list is a string, programmers generally don't.

  • Custom User Avatar

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

  • Custom User Avatar
  • Custom User Avatar

    First of all, thanks!
    About the round subject, it's true that the way that it was written could lead to a misunderstanding of the task so I have changed it.

    Also, I will keep the sugestion in mind for what will most likely become the second part of this kata, harder and definitely more interesting!

  • Loading more items...