Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Thanks ;-)
Very polite explanation tx
Closing now.
OK, how's this description now?
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.
Clever idea, but I'd rather not do that. It makes output too unreadable.
You can always ask for the set of indices of the elements instead, that's always going to be a set by definition.
And if I don't change the requirements, the middle part of that could become
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.
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.
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
andString
can both be encoded as lists ( or arrays, or vectors, or sequences, or even Python tuples ).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.
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.
This comment is hidden because it contains spoiler information about the solution
Done
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...