Yahoo Interview Question

The logic games were a bit odd.