Pregunta de entrevista de Uber

Standard Algorithms questions. Reading Crack the Coding Interview really helps.