The business has been suffering for years under the watch of Homie the Clown. Every time there is a push to production it requires 500 hands-on deck, a massive manual process, and the fire department is on stand-by along with Fire Marshall Bill the king of manual configuration management. He is called a Fire Marshall because production pushes often burst into flames and rollbacks are a hazard.

The business demands change and as such has hired a new leader who wants to convert it all to DevOps…..there is a new Sheriff in town.

The Sheriff's first order of business is to build a DevOps team. He likes Microservices, Cloud, Open-Source, and wants to push to production 9500 times per day without even pressing a button, beautiful seamless immutable infrastructure properly baked in the Continuous Delivery oven is the goal.

The only problem is Homie the Clown along with Legacy Pete are grandfathered in and union, they started out in the era of green screens and punch cards and are set in their ways. They are not paid by an outcome but instead are measured by the amount of infrastructure under management and total staff headcount.

The Sheriff has hired a new team of DevOps Engineers. They advocate Open Source, Cloud, and never doing a manual task more than one time. They believe Operations to be a first class citizen with Development and are preparing to shake things up within the company. 

Since Legacy is not going away, yet, the Sheriff's job is to get everyone to cooperate so DevOps and the Cloud will be standard. The New Kids on the Block have just started work and are looking to build common services with Legacy Pete and Homie the Clown. 
```
Every Time the NKOTB propose a DevOps pattern…… 

Homie stands up and says "Homie don't Play that!"

IE: 

NKOTB Say -> "We need Cloud now!"

Homie Say -> "Cloud! Homie dont play that!"

NKOTB Say -> "We need Automation now!"

Homie Say -> "Automation! Homie dont play that!"

NKOTB Say -> "We need Microservices now!"

Homie Say -> "Microservices! Homie dont play that!"

```

Task 

You will receive a two-dimensional array with strings made of the NKOTB’s requirements. Each Array contains a domain of DevOps patterns that each of the 5 NKOTB are asking for.

The requirements array will ALWAYS have five sub-arrays structured like this:
```
requirements[0] = monitoring
requirements[1] = automation
requirements[2] = deployment
requirements[3] = cloud
requirements[4] = microservices

Each sub-array will always contain strings in the same format

The strings will always be in the following format(case insensitive):

"We need Microservices now!"

Your job is to create the response from Homie the Clown following the pattern above. 

Then return the responses in an array.

"Microservices! Homie dont play that!"
```
The first word of the response is always Capitalized and all other letters are lowercase regardless of how you recieve them, the rest of the sentence is always in the format ``` Homie dont play that!```. Strings should be returned in the same order.
```
In addition to the responses create a count of each domain and return it as the last element of the return array in the following format.

'6 monitoring objections, 4 automation, 6 deployment pipeline, 6 cloud, and 3 microservices.'

```
For more information on Homie the Clown.

https://www.youtube.com/watch?v=_QhuBIkPXn0

Fire Marshall Bill on Vacation!

https://www.youtube.com/watch?v=IIIsCB4Y8sw#t=202.002651

Source: codewars | Difficulty: EASY

Starter code: def nkotb_vs_homie(requirements):
	

Solutions:
def nkotb_vs_homie(requirements):
	return ['{}! Homie dont play that!'.format(a[8:-5].title()) for b in requirements for a in b] + ['{} monitoring objections, {} automation, {} deployment pipeline, {} cloud, and {} microservices.'.format(*(len(x) for x in requirements))]


res1 = '{}! Homie dont play that!'.format
res2 = '{} monitoring objections, {} automation, {} deployment pipeline, {} cloud, and {} microservices.'.format
get = __import__('re').compile('We need (\\w+) now!').search

def nkotb_vs_homie(requirements):
	return [res1(get(req).group(1).capitalize()) for reqs in requirements for req in reqs] + [res2(*map(len, requirements))]


TOTAL = '{} monitoring objections, {} automation, {} deployment pipeline, {} cloud, and {} microservices.'

def nkotb_vs_homie(r):
	result = []
	for req in sum(r, []):
		homie = req.split()[2].title()
		result.append(f'{homie}! Homie dont play that!')
	result.append(TOTAL.format(*map(len, r)))
	return result


import re

def nkotb_vs_homie(requirements):
	return ['{}! Homie dont play that!'.format(s[8:-5].capitalize()) for r in requirements for s in r] + ['{} monitoring objections, {} automation, {} deployment pipeline, {} cloud, and {} microservices.'.format(*map(len, requirements))]


def nkotb_vs_homie(requirements):
	return [f'{v.split()[2].title()}! Homie dont play that!' for lst in requirements for v in lst] + [', '.join((f"{['', 'and '][a == 'microservices']}{len(b)} {a}" for (a, b) in zip(['monitoring objections', 'automation', 'deployment pipeline', 'cloud', 'microservices'], requirements))) + '.']


def services(service_list):
	hdpt = 'Homie dont play that!'
	names = [req.split()[2].capitalize() + '! ' + hdpt for req in service_list]
	return names

def nkotb_vs_homie(requirements):
	monitoring = services(requirements[0])
	automation = services(requirements[1])
	deployment = services(requirements[2])
	cloud = services(requirements[3])
	microservices = services(requirements[4])
	report = '{} monitoring objections, {} automation, {} deployment pipeline, {} cloud, and {} microservices.'.format(len(monitoring), len(automation), len(deployment), len(cloud), len(microservices))
	compiled = []
	compiled += monitoring
	compiled += automation
	compiled += deployment
	compiled += cloud
	compiled += microservices
	compiled.append(report)
	print(compiled)
	return compiled


def nkotb_vs_homie(r):
	output = []
	for req in r:
		for requirement in req:
			require = requirement.split(' ')
			output.append(require[2].capitalize() + '! Homie dont play that!')
	final = str(len(r[0])) + ' monitoring objections, ' + str(len(r[1])) + ' automation, ' + str(len(r[2])) + ' deployment pipeline, ' + str(len(r[3])) + ' cloud, and ' + str(len(r[4])) + ' microservices.'
	output.append(final)
	return output


def nkotb_vs_homie(requirements):
	requirements = list(requirements)
	temp = []
	for i in range(len(requirements)):
		requirements[i] = list(map(lambda x: x.replace('We need ', '').replace(' now!', '').title(), requirements[i]))
		for j in requirements[i]:
			temp.append(j)
	temp = list(map(lambda x: x + '! Homie dont play that!', temp))
	lengths = list(map(lambda x: len(x), requirements))
	lastSentence = '%d monitoring objections, %d automation, %d deployment pipeline, %d cloud, and %d microservices.' % (lengths[0], lengths[1], lengths[2], lengths[3], lengths[4])
	temp.append(lastSentence)
	return temp


def nkotb_vs_homie(requirements):
	r = []
	c = []
	for reqs in requirements:
		for req in reqs:
			r.append(req.split(' ')[2].title() + '! Homie dont play that!')
		c.append(len(reqs))
	r.append('{0[0]} monitoring objections, {0[1]} automation, {0[2]} deployment pipeline, {0[3]} cloud, and {0[4]} microservices.'.format(c))
	return r


def nkotb_vs_homie(requirements):
	res = []
	for arr in requirements:
		for item in arr:
			aux = item[8:-5].title()
			res.append('{}! Homie dont play that!'.format(aux))
	res.append('{} monitoring objections, {} automation, {} deployment pipeline, {} cloud, and {} microservices.'.format(*map(len, requirements)))
	return res