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
 Create a set For each number, calculate the absolute difference between it and its predecessor and add the difference to the set 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