Pregunta de entrevista de Meta

Basic LC questions at medium difficulty.