In this Kata you are a builder and you are assigned a job of building a wall with a specific size (God knows why...).

Create a function called `build_a_wall` (or `buildAWall` in JavaScript) that takes `x` and `y` as integer arguments (which represent the number of rows of bricks for the wall and the number of bricks in each row respectively) and outputs the wall as a string with the following symbols:

`■■` => One full brick (2 of `■`)

`■` => Half a brick

`|` => Mortar (between bricks on same row)

There has to be a `|` between every two bricks on the same row. For more stability each row's bricks cannot be aligned vertically with the bricks of the row above it or below it meaning at every 2 rows you will have to make the furthest brick on both sides of the row at the size of half a brick (`■`) while the first row from the bottom will only consist of full bricks. Starting from the top, every new row is to be represented with `\n` except from the bottom row. See the examples for a better understanding.

If one or both of the arguments aren't valid (less than 1, isn't integer, isn't given...etc) return `None` in Python.

If the number of bricks required to build the wall is greater than 10000 return `"Naah, too much...here's my resignation."`

Examples, based on Python:
```
build_a_wall(5,5) => '■■|■■|■■|■■|■■\n■|■■|■■|■■|■■|■\n■■|■■|■■|■■|■■\n■|■■|■■|■■|■■|■\n■■|■■|■■|■■|■■'

build_a_wall(10,7) => '■|■■|■■|■■|■■|■■|■■|■\n■■|■■|■■|■■|■■|■■|■■\n■|■■|■■|■■|■■|■■|■■|■\n■■|■■|■■|■■|■■|■■|■■\n■|■■|■■|■■|■■|■■|■■|■\n■■|■■|■■|■■|■■|■■|■■\n■|■■|■■|■■|■■|■■|■■|■\n■■|■■|■■|■■|■■|■■|■■\n■|■■|■■|■■|■■|■■|■■|■\n■■|■■|■■|■■|■■|■■|■■'

build_a_wall("eight",[3]) => None  }
                                   }> Invalid input
build_a_wall(12,-4) => None        }

build_a_wall(123,987) => "Naah, too much...here's my resignation."
123 * 987 = 121401 > 10000
```

Source: codewars | Difficulty: EASY
Tags: String algorithms

Fundamentals

Starter code: def build_a_wall(x=0, y=0):
	

Solutions:
def build_a_wall(x=0, y=0):
	if type(x) != int or type(y) != int or x < 1 or (y < 1):
		return
	if x * y > 10000:
		return "Naah, too much...here's my resignation."
	res = [['■■'] * y if i & 1 ^ x & 1 else ['■'] + ['■■'] * (y - 1) + ['■'] for i in range(x)]
	return '\n'.join(map('|'.join, res))


def build_a_wall(x=0, y=0):
	if not x or not y or type(x) != int or (type(y) != int) or (x < 0) or (y < 0):
		return
	if x * y > 10000:
		return "Naah, too much...here's my resignation."
	(brick, half) = ('■■', '■')
	(m, s) = ('|'.join([brick] * y), half + '|' + '|'.join([brick] * (y - 1)) + '|' + half)
	return '\n'.join([[m, s][i & 1 == x & 1] for i in range(x)])


FULL = '■■'
HALF = '■'
SEP = '|'

def build_a_wall(x=None, y=None):
	if any((not isinstance(item, int) or item < 1 for item in (x, y))):
		return None
	if x * y > 10000:
		return "Naah, too much...here's my resignation."
	base_row = SEP.join([FULL] * (y - 1))
	odd_row = SEP.join([base_row, FULL])
	even_row = SEP.join([HALF, base_row, HALF])
	return '\n'.join((odd_row if i % 2 else even_row for i in range(-x, 0)))


def generateBricks(isCut, y):
	return '{0}|{1}|{0}'.format('■' * (1 + isCut), '|'.join(('■■' for _ in range(y - 1 - isCut))))

def build_a_wall(*args):
	if len(args) != 2 or any((type(z) != int or z <= 0 for z in args)):
		return None
	(x, y) = args
	return "Naah, too much...here's my resignation." if x * y > 10000 else '\n'.join((generateBricks((x - nr) % 2, y) for nr in range(x)))


def build_a_wall(x=None, y=None):
	if isinstance(x, int) and isinstance(y, int) and (x > 0) and (y > 0):
		if x * y > 10000:
			return "Naah, too much...here's my resignation."
		hb = '■'
		b = hb + hb
		even = ((b + '|') * y)[:-1]
		odd = hb + '|' + (b + '|') * (y - 1) + hb
		return '\n'.join([even if r % 2 == 0 else odd for r in range(x - 1, -1, -1)])
	return None


def build_a_wall(x=0, y=0):
	if isinstance(x, int) and isinstance(y, int) and (x > 0) and (y > 0):
		if x * y > 10000:
			return "Naah, too much...here's my resignation."
		a = '|'.join(['■■'] * y)
		b = '|'.join(['■'] + ['■■'] * (y - 1) + ['■'])
		if x % 2:
			(a, b) = (b, a)
		return '\n'.join((a if i % 2 else b for i in range(x)))


def build_a_wall(x=0, y=0):
	brick = '■'
	if isinstance(x, int) and isinstance(y, int):
		if x < 1 or y < 1:
			return None
		elif x * y > 10000:
			return "Naah, too much...here's my resignation."
		else:
			brick = '■'
			line1 = ['■']
			line2 = []
			for i in range(y - 1):
				line1.append(2 * brick)
				line2.append(2 * brick)
			line1.append(brick)
			line2.append(2 * brick)
			line1 = '|'.join(line1)
			line2 = '|'.join(line2)
			total = []
			odd = (x + 1) % 2
			for i in range(odd, x + odd):
				if i % 2 == 1:
					total.append(line1)
				else:
					total.append(line2)
			total = '\n'.join(total)
			return total
	else:
		return None


def build_a_wall(x=None, y=None):
	try:
		if x * y > 10000:
			return "Naah, too much...here's my resignation."
		if x * y <= 0:
			raise Exception
		d = ['|'.join(['■■'] * y), '|'.join(['■'] + ['■■'] * (y - 1) + ['■'])]
		r = []
		for i in range(x):
			r.append(d[i % 2])
		return '\n'.join(r[::-1])
	except:
		return


def build_a_wall(x=None, y=None):
	if not all([isinstance(x, int), isinstance(y, int)]) or x < 1 or y < 1:
		return None
	elif x * y > 10000:
		return "Naah, too much...here's my resignation."
	else:
		halfbrick = '■'
		brick = 2 * halfbrick
		mortar = '|'
		wall = ''
		for i in range(x):
			if i % 2 == 0:
				wall = brick + (mortar + brick) * (y - 1) + wall
			else:
				wall = halfbrick + (mortar + brick) * (y - 1) + mortar + halfbrick + wall
			wall = '\n' + wall if i < x - 1 else wall
		return wall