Compare multiple values in an array

Hi, could anyone put me on the right way to solving this problem, the truth is im not even sure how to structure it before Ive even got down to coding…

the scene

values = new Array("v1", "v2", "v3", "v4", "v5");

I have 100+ records in this array. v1 - v5 all contain number values.

Now I have to create a for loop to find if the number of occurances if/where there is a difference of 1 between any of the “v” values.

Example
if these were the 3 entries in my array…

values[0] = (62,63,45,35,21);
values[1] = (14,17,211,80,73);
values[2] = (12,34,87,88,89);

I would want a trace like…

values[0] has 1 occurance
values[1] has 0 occurance
values[2] has 2 occurance

Any suggestions?

Thanx