На основе этой реализации двух указателей из cplusplus.com :
template <class InputIterator1, class InputIterator2>
bool includes (InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, InputIterator2 last2)
{
while (first2!=last2) {
if ( (first1==last1) || (*first2<*first1) ) return false;
if (!(*first1<*first2)) ++first2;
++first1;
}
return true;
}
Первый указатель выдвигается, когда сопоставляется один символ.Поэтому вам нужно два a
символа, так как в Alaska
.
есть два из них. Дополнительный a
в векторе дает желаемый результат:
vector<char>secondRowInKeyboard{'a','a','A','s','S','d','D','f','F','g','G','h','H','j','J','k','K','l','L' };