Locatee interview question

Logical thinking, coding, time complexity