Block Interview Question

General coding question - medium difficulty