Block interview question

Regular CS and algorithm question. Nothing tricky.