Dentsu Interview Question

They asked me to solve a coding problem using arrays and explain the time complexity.