C++ STL includes
(http://www.cplusplus.com/reference/algorithm/includes/) Test whether sorted range includes another sorted range
Returns true if the sorted range [first1,last1) contains all the elements in the sorted range [first2,last2)
void Test_STL_Includes() {
vector<char>secondRowInKeyboard{ 'a','A','s','S','d','D','f','F','g','G','h','H','j','J','k','K','l','L' };
sort(secondRowInKeyboard.begin(), secondRowInKeyboard.end());
string s("Alaska");
sort(s.begin(), s.end());
if (includes(secondRowInKeyboard.begin(), secondRowInKeyboard.end(), s.begin(), s.end()))
{
cout << "Matches";
}
else
{
cout << "Not Matches";
}
}
Expected: "Matches"
Actual: "Not Matches"
Am I making some mistake?