std::lexicographical_compare
From cppreference.com
C++
Algorithm library