# Task
A masked number is a string that consists of digits and one asterisk (`*`) that should be replaced by exactly one digit. Given a masked number `s`, find all the possible options to replace the asterisk with a digit to produce an integer divisible by 6.


# Input/Output

`[input]` string `s`

A masked number.

`1 ≤ inputString.length ≤ 10000.`

`[output]` a string array

Sorted array of strings representing all non-negative integers that correspond to the given mask and are divisible by 6.

# Example

For `s = "1*0"`, the output should be `["120", "150", "180"].`

For `s = "*1"`, the output should be `[].`

For `s = "1234567890123456789012345678*0"`, 

the output should be 
```
[
"123456789012345678901234567800",
"123456789012345678901234567830",
"123456789012345678901234567860",
"123456789012345678901234567890"]```
As you can see, the masked number may be very large ;-)

Source: codewars | Difficulty: EASY
Tags: Ad-hoc

Starter code: def is_divisible_by_6(s):
	

Solutions:
def is_divisible_by_6(s):
	all_numbers = [int(s.replace('*', str(n))) for n in range(10)]
	return [str(n) for n in all_numbers if n % 6 == 0]


def is_divisible_by_6(stg):
	result = []
	for d in '0123456789':
		r = int(d.join(stg.split('*')))
		if r % 6 == 0:
			result.append(str(r))
	return result


def is_divisible_by_6(s):
	if s[-1] != '*':
		if int(s[-1]) % 2 == 1:
			return []
		else:
			lst = []
			for i in range(10):
				if int(s.replace('*', str(i))) % 3 == 0:
					lst.append(int(s.replace('*', str(i))))
			for x in range(len(lst)):
				lst[x] = str(lst[x])
			return lst
	else:
		lst = []
		for i in [0, 2, 4, 6, 8]:
			lst.append(s[:-1] + str(i))
		lst2 = []
		for x in range(len(lst)):
			if int(lst[x]) % 3 == 0:
				lst2.append(lst[x])
		return lst2


def is_divisible_by_6(s):
	xs = [s.replace('*', str(i)) for i in range(10)]
	return [x.lstrip('0') or '0' for x in xs if int(x) % 6 == 0]


def is_divisible_by_6(s):
	out = []
	for digit in '0123456789':
		div = int(s.replace('*', digit))
		if div % 6 == 0:
			out.append(str(div))
	return out


def is_divisible_by_6(s):
	x = [s.replace('*', str(i)) for i in range(10)]
	x = [i for i in x if int(i) % 6 == 0]
	x = [i[1:] if i[0] == '0' and len(i) > 1 else i for i in x]
	return x


from functools import reduce

def is_divisible_by_6(s):
	digits = list(range(0, 10))
	perm = [s.replace('*', str(d)) for d in digits]
	res = [s for s in perm if isDiv2(s) and isDiv3(s)]
	return [x.lstrip('0') if len(x) > 1 else x for x in res]

def isDiv2(n):
	return int(n[-1]) % 2 == 0

def isDiv3(n):
	d = [int(x) for x in list(n) if x != '*']
	sum = reduce(lambda a, b: a + b, d)
	return sum % 3 == 0


def is_divisible_by_6(s):
	ls = []
	for x in range(10):
		if int(s.replace('*', str(x))) % 6 == 0:
			ls.append(s.replace('*', str(x)))
	for x in ls:
		if len(x) > 1 and x[0] == '0':
			ls.insert(ls.index(x), x[1:])
			ls.remove(x)
	return ls


def is_divisible_by_6(s):
	if s == '*':
		return ['0', '6']
	elif s[-1].isdigit() and int(s[-1]) % 2:
		return []
	check = s.index('*')
	res = []
	digit_sum = sum((int(i) for i in s[:check] + s[check + 1:]))
	for i in range(10):
		if check == len(s) - 1 and i % 2 == 0 and ((i + digit_sum) % 3 == 0) or (check != len(s) - 1 and (i + digit_sum) % 3 == 0):
			res.append(str(int(s[:check] + str(i) + s[check + 1:])))
	return res