0

I have this code:

        HashSet<int> arr = new HashSet<int> { 1, 1, 2 };

        HashSet<List<int>> arrOfarr = new HashSet<List<int>>();
        arrOfarr.Add(new List<int> { 1,2,3 });
        arrOfarr.Add(new List<int> { 1,2,3 });

Due to arr is a Hashset so obviously it returns {1,2} but I am wondering why arrOfarr returns both similar arrays. How does it works? How to change that to not return duplicate arrays?

2

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.