title: count number of subsets with atmost k distinct elements
body: <p>given a set of inetegers, count the number of subsets with atmost k distinct elements. <br>
  eg: set is {1,1,2,3,3} and k = 2:</p>
  
  <p>possible subsets are: <br>
  {} - empty set<br>
  {1} <br>
  {1} <br>
  {2} <br>
  {3} <br>
  {3} <br>
  {1,1} <br>
  {1,2} <br>
  {1,3} <br>
  {1,3} <br>
  {1,2} <br>
  {1,3} <br>
  {1,3} <br>
  {2,3} <br>
  {2,3} <br>
  {1,1,2} <br>
  {1,1,3} <br>
  {1,1,3} <br>
  {1,3,3} <br>
  {1,3,3} <br>
  {2,3,3} <br>
  {1,1,3,3} <br>
  my solution was to iterate all the possible subsets and check whether there are less k+1 elements.. but it was so slow.. O(2^n)</p>