UVa 10038 - Jolly Jumpers

10038 - Jolly Jumpers

 * http://acm.uva.es/p/v100/10038.html

Summary
Determine if a sequence of numbers follows a pattern.

Explanation
1. Create a set 2. For each number, calculate the absolute difference between it and its predecessor 3. Add the difference to the set 4. If the size of the set is n-1, output "Jolly"

Gotcha's

 * The size of the input (3000) is on the large-ish size
 * Make sure the differences are all between 1 and n-1

Input
4 1 4 2 3 5 1 4 2 -1 6

Output
Jolly Not jolly