Block Interview Question

LC easy/medium, not too difficult