Arista Networks interview question

Basic algorithm question in C.