Given the following code snippet :
string s = “bca”;
do {
cout << s << ’ ';
} while(next_permutation(s.begin(), s.end()));
cout << s;
What is the output of the given code?
bca cab cba abc
bca cab cba cba
bca bca bca bca
bca cab cba bca
in the output why abc the last element