Pergunta de entrevista da empresa Citi

Very basic questions on data structures and time complexities and algorithms,1 puzzle just for checking how you approach the problem