Pregunta de entrevista de Upstart

brainteaser, prob, and algorithm related questions