title: All permutations of length k from n characters with repetition in CPP
body: <p>I would like to know if there is already an implementation in CPP to find all permutations of n characters of length k(1,2,3,4 etc) with repetitions. I hope there is but i could not find. </p>
  
  <p>For example if <code>string= (A,B,C,D)</code> and i want find all permutations of <code>string</code> with repetitions of length <code>k =2</code>.</p>
  
  <p>The output will be something like :</p>
  
  <pre><code>AA
  AB
  AC
  AD
  .
  .
  .
  DD
  </code></pre>
  
  <p>total permutations of 16.  </p>