helo..wan ask something. i permutate this 2314 as below for all combination.
let say after i permutate, i want to compare a string(exmple string name("3214") with all the combination comes from permutation just now. And finally display the one from the combination that same with 3124. How to do this?? help plz..
// Assume this is what you want to permute:
string numbers( "2314" );
int i=0;
// next_permutation requires the first permutation to be in sorted order
sort( numbers.begin(), numbers.end() );
// The sorted sequence is the first permutation
cout << numbers << endl;