Pergunta de entrevista da empresa Yahoo

Questions on Arrays, with reducing memory complexity and time complexity