Paintzen Interview Question

3 JavaScript algorithm questions of various difficulty.