WSP Interview Question

A group problem about calculating no of blocks