Block interview question

Very simple algorithm and data structure