Spoonerize... with numbers... numberize?... numboonerize?... noonerize? ...anyway!  If you don't yet know what a spoonerism is and haven't yet tried my spoonerism kata, please do [check it out](http://www.codewars.com/kata/spoonerize-me) first.

You will create a function which takes an array of two positive integers, spoonerizes them, and returns the positive difference between them as a single number or ```0``` if the numbers are equal:
```
[123, 456] = 423 - 156 = 267
```
Your code must test that all array items are numbers and return ```"invalid array"``` if it finds that either item is not a number.  The provided array will always contain 2 elements.

When the inputs are valid, they will always be integers, no floats will be passed.  However, you must take into account that the numbers will be of varying magnitude, between and within test cases.

Source: codewars | Difficulty: EASY
Tags: Data structures

Mathematics

Starter code: def noonerize(numbers):
	

Solutions:
def noonerize(numbers):
	try:
		num1 = int(str(numbers[1])[0] + str(numbers[0])[1:])
		num2 = int(str(numbers[0])[0] + str(numbers[1])[1:])
	except ValueError:
		return 'invalid array'
	return abs(num1 - num2)


def noonerize(numbers):
	if not all((isinstance(n, int) for n in numbers)):
		return 'invalid array'
	(a, b) = map(str, numbers)
	return abs(int(a[0] + b[1:]) - int(b[0] + a[1:]))


def noonerize(numbers):
	(a, b) = numbers
	if not type(a) == int == type(b):
		return 'invalid array'
	(a, b) = map(str, numbers)
	return abs(int(a[0] + b[1:]) - int(b[0] + a[1:]))


def noonerize(numbers):
	if all((isinstance(x, int) for x in numbers)):
		(a, b) = (str(x) for x in numbers)
		return abs(int(b[0] + a[1:]) - int(a[0] + b[1:]))
	return 'invalid array'


def noonerize(numbers):
	(nb1, nb2) = map(str, numbers)
	try:
		return abs(int(nb2[0] + nb1[1:]) - int(nb1[0] + nb2[1:]))
	except ValueError:
		return 'invalid array'


def noonerize(n):
	try:
		return abs(int(str(n[1])[0] + str(n[0])[1:]) - int(str(n[0])[0] + str(n[1])[1:])) if n[0] != n[1] else 0
	except:
		return 'invalid array'


def noonerize(numbers):

	def spoonerize(numbers):
		(a, b) = [str(n) for n in numbers]
		return '{}{} {}{}'.format(b[0], a[1:], a[0], b[1:])
	if all((isinstance(n, int) for n in numbers)):
		(a, b) = map(int, spoonerize(numbers).split())
		return abs(a - b)
	else:
		return 'invalid array'


def noonerize(numbers):
	output = '{}{}'.format
	if any((not isinstance(a, int) for a in numbers)):
		return 'invalid array'
	(b, c) = (str(d) for d in numbers)
	return abs(int(output(c[0], b[1:])) - int(output(b[0], c[1:])))