# Combinatorics puzzle

I am having a problem dealing with following topic:

lets say we have set of numbers n = [ 1 2 2 3 ] and we want be able to get all two-elementary combinations out of that(1.) and remove all repetitions(2.).

1.) Using combination formula n!/(k! (n - k)!) we end up having 6 pairs

([1 2], [1 2], [1 3], [2 2], [2 3], [2 3])


2.) Now I do not know how to compute amount of repetitions I need to get rid of ([1 2], [2 3]) to get clean set of 4 elements ([1 2], [1 3], [2 2], [2 3]).

Can someone explain me how to deal with these problems, please? I need to learn how algorithm works so I can create different size of subgroups from elements that may repeat.

P.S. it is important to result with a set of unique subgroups, not a quantity of them.

-