In this Kata, you will be given an array of numbers and a number `n`, and your task will be to determine if `any` array elements, when summed (or taken individually), are divisible by `n`. 

For example:

  * `solve([1,3,4,7,6],9) == true`, because `3 + 6` is divisible by `9`
  * `solve([1,2,3,4,5],10) == true` for similar reasons.
  * `solve([8,5,3,9],7) == true`, because `7` evenly divides `5 + 9`
  * but `solve([8,5,3],7) == false`.
  
All numbers in the array will be greater than `0`. 

More examples in the test cases.
  
Good luck!

If you like this Kata, please try:

[Simple division](https://www.codewars.com/kata/59ec2d112332430ce9000005)

[Divisor harmony](https://www.codewars.com/kata/59bf97cd4f98a8b1cd00007e)

Source: codewars | Difficulty: EASY
Tags: Fundamentals

Data structures

Starter code: def solve(arr,n):
	

Solutions:
from itertools import combinations

def solve(a, n):
	return any((sum(c) % n == 0 for i in range(len(a)) for c in combinations(a, i + 1)))


def solve(xs, n):
	rs = set()
	for x in xs:
		for r in list(rs):
			rs.add((r + x) % n)
		rs.add(x % n)
	return 0 in rs


from itertools import combinations

def solve(arr, n):
	return any((sum(xs) % n == 0 for i in range(len(arr)) for xs in combinations(arr, i + 1)))


from itertools import combinations

def solve(x, n):
	return any((sum(cb) % n == 0 for k in range(len(x)) for cb in combinations(x, k + 1)))


from itertools import combinations

def solve(x, n):

	def combs(x):
		return [c for i in range(1, len(x) + 1) for c in combinations(x, i)]
	return any(map(lambda x: sum(x) % n == 0, combs(x)))


from itertools import combinations

def solve(arr, n):
	for i in range(1, len(arr) + 1):
		for j in combinations(arr, i):
			if sum(j) % n == 0:
				return True
	return False


from itertools import combinations

def solve(arr, n):
	return next((True for x in range(1, len(arr) + 1) for c in combinations(arr, x) if not sum(c) % n), False)


solve = lambda a, n: any((sum(c) % n < 1 for r in range(len(a)) for c in __import__('itertools').combinations(a, r + 1)))