In this Kata, you will be given an array of integers and your task is to return the number of arithmetic progressions of size `3` that are possible from that list. In each progression, the differences between the elements must be the same.

```
[1, 2, 3, 5, 7, 9] ==> 5
// [1, 2, 3], [1, 3, 5], [1, 5, 9], [3, 5, 7], and [5, 7, 9]
```

All inputs will be sorted. More examples in test cases. 

Good luck!

Source: codewars | Difficulty: EASY

Starter code: def solve(arr):
	

Solutions:
def solve(arr):
	return sum((y - x == z - y for (i, x) in enumerate(arr[:-2]) for (j, y) in enumerate(arr[i + 1:-1]) for (_, z) in enumerate(arr[j + 1:])))


from itertools import combinations

def solve(xs):
	return sum((1 for (a, b, c) in combinations(xs, 3) if a - b == b - c))


def solve(arr):
	return sum((x < y and y * 2 - x in arr for x in arr for y in arr))


def solve(arr):
	return sum((num + i in arr and num + 2 * i in arr for i in range(1, arr[-2] + 1) for num in arr[:-2]))


from itertools import combinations

def solve(arr):
	S = set(arr)
	return sum((2 * y - x in S for (x, y) in combinations(arr, 2)))


from itertools import combinations

def solve(a):
	return sum((q + (q - p) in a for (p, q) in combinations(a, 2)))


from itertools import combinations

def solve(arr):
	return sum((b - a == c - b for (a, b, c) in combinations(arr, 3)))


import itertools

def solve(arr):
	n = 0
	nums = set(arr)
	for com in itertools.combinations(arr, 2):
		diff = com[1] - com[0]
		if com[1] + diff in nums:
			n += 1
	return n


from itertools import combinations

def help67(arr):
	S = set(arr)
	for (a, b) in combinations(arr, 2):
		if 2 * b - a in S:
			yield (a, b, 2 * b - a)

def solve(arr):
	c = 0
	for i in help67(arr):
		c += 1
	return c