IBM Interview Question

The aptitude test was a bit difficult