DRW Interview Question

Difficult programming assignment.