0

I have a task to do for my classes. I need a collection to keep unique values, but java.util.Set is not enough for me.

What I have to do - if I add words "dogs" and "cats" to collection and afterwards I try to add "dog" and "cat", in my collection will be only the "dogs" and "cats".

If I add "ABCDEFG" and afterwards I try to add "BCDE", "DEFG", etc., it will not be added to my collection too.

How can I write this code?

4

0 回答 0