Complexity Given result as the return value of adjacent_find, M as std::distance(first, result) and N as std::distance(first, last):
Complexity Given result as the return value of adjacent_find, M as std::distance(first, result) and N as std::distance(first, last):