Pregunta de entrevista de Streamlyn

Usual LC problems (mostly easy and medium) not with interview preparation in mind as such.