An array is given eg:-1 2 2 2 and we need to count the number of subsets for it of size k which has the sum of elements minimum possible
here the subsets of size k=3 are:- 122 122 122 222
we see that there are 3 subsets having the minimum sum
I did this in bruteforce approach..first I stored the subsets of size k in a vector and then found the sum for each of the subsets and stored them in another vector and then counted the frequency of the minimum element
how to optimize it?