A scala solution to the Paintshop problem, using streams to support a back-tracking algorithm.