Advertisement
Guest User

Untitled

a guest
Nov 20th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.23 KB | None | 0 0
  1. void rec(string now, vector<int> have){
  2.    
  3.     if(have.size() == 0){
  4.         cout << now;
  5.         return;
  6.     }
  7.  
  8.     for(int i = 0; i <= 'z' - 'a'; i++){
  9.         if(have[i] > 0){
  10.             have[i]--;
  11.             rec(now + (char)('a'+i), have);
  12.             have[i]++;
  13.         }
  14.     }
  15.  
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement