title: Find all subsets of length k in an array
body: <p>Given a set <code>{1,2,3,4,5...n}</code> of n elements, we need to find all subsets of length k . </p>
  
  <p>For example, if n = 4 and k = 2, the <code>output</code> would be <code>{1, 2}, {1, 3}, {1, 4}, {2, 3}, {2, 4}, {3, 4}</code>.</p>
  
  <p>I am not even able to figure out how to start. We don't have to use the inbuilt library functions like next_permutation etc.</p>
  
  <p>Need the algorithm and implementation in either C/C++ or Java.</p>