The goal of this Kata is to return the greatest distance of index positions between matching number values in an array or 0 if there are no matching values.  

Example:
In an array with the values [0, 2, 1, 2, 4, 1] the greatest index distance is between the matching '1' values at index 2 and 5.  Executing greatestDistance against this array would return 3. (i.e. 5 - 2)  

Here's the previous example in test form:
```python
test.assert_equals(greatest_distance([0, 2, 1, 2, 4, 1]), 3)
```

This is based on a Kata I had completed only to realize I has misread the instructions.  I enjoyed solving the problem I thought it was asking me to complete so I thought I'd add a new Kata for others to enjoy.  There are no tricks in this one, good luck!

Difficulty: introductory

Starter code:

def greatest_distance(arr):
	

Solutions:
def greatest_distance(arr):
    return max(i - arr.index(x) for i,x in enumerate(arr))

def greatest_distance(arr):
    indexes, d = {}, 0
    for i,n in enumerate(arr):
        if n in indexes: d = max(d, i-indexes[n])
        else:            indexes[n] = i
    return d

def greatest_distance(lst):
    return max((distance(lst, n) for n in set(lst) if lst.count(n) > 1), default=0)


def distance(lst, item):
    return len(lst) - 1 - lst[::-1].index(item) - lst.index(item)


from collections import defaultdict

def greatest_distance(a):
    d = defaultdict(list)
    for i, x in enumerate(a):
        d[x].append(i)
    return max(x[-1] - x[0] for x in d.values())

def greatest_distance(data):
    i = 0; d = 0
    while (i < len(data)):
        j = i + 1
        while (j < len(data)):
            if (data[j] == data[i]):
                if (j - i > d): d = j - i
            j += 1
        i += 1
    return d;

greatest_distance=lambda a:max(i-a.index(e)for i,e in enumerate(a))

greatest_distance=lambda a:max(len(a)-a[::-1].index(e)-a.index(e)-1for e in a)

from collections import defaultdict


def greatest_distance(arr):
    indexes = defaultdict(list)
    for i, a in enumerate(arr):
        indexes[a].append(i)
    try:
        return max(b[-1] - b[0] for b in indexes.values() if len(b) > 1)
    except ValueError:
        return 0


def greatest_distance(arr):
    res = 0
    for i, x in enumerate(arr): 
        for j, y in enumerate(arr): 
            if y==x: 
                res = max(res, abs(i-j))
    return res

from collections import Counter

def greatest_distance(arr):
    r_arr, count_arr = arr[::-1], Counter(arr)
    return max(len(arr) - 1 - r_arr.index(k) - arr.index(k) if c > 1 else 0 for k, c in count_arr.items())