combination sumsIf I got your question right, then sort the array and take the minimum n elements. r
This user does not accept Private Messages