Arista Networks interview question

Q.1 DSA problem on array (needs to be in 'C' language)