TooEz's blog

By TooEz, history, 2 months ago, In English,

I am facing runtime error and I can't seem to find the issue. The code is here. Any help is appreciated.

Problem Statement :
  • Vote: I like it
  • +1
  • Vote: I do not like it

2 months ago, # |
Rev. 3   Vote: I like it 0 Vote: I do not like it

You may use std::next_permutation instead of writing your own generator. It usually used like this:

string test = "ABCD";
    cout << test << endl
} while(std::next_permutation(test.begin(), test.end());

Cycle ends when string is sorted in reverse way