Pregunta de entrevista de Google

Design an algorithm to do X, then analyse the complexity.