IBM Interview Question

Puzzle solving