Arista Networks interview question

Divide and conquer problem in C++