According to Gary Chapman, marriage counselor and the author of ["The Five Love Languages"](https://en.wikipedia.org/wiki/The_Five_Love_Languages) books, there are five major ways to express our love towards someone: *words of affirmation, quality time, gifts, acts of service,* and *physical touch*. These are called the love languages. Usually, everyone has a main language: the one that he/she "speaks" and understands best. In a relationship, it's import to find your partner's main love language, so that you get along better with each other.

## Your task

Unfortunately, your relationship got worse lately... After a long discussion with your partner, you agreed to give yourself a few weeks to improve it, otherwise you split up...

You will be given a `partner` instance, and `n` weeks. The `partner`  has a `.response` method, and the responses may be: `"positive"` or `"neutral"`. You can try to get a response once a day, thus you have `n * 7` tries in total to find the main love language of your partner!

```if-not:haskell
The love languages are: `"words", "acts", "gifts", "time", "touch"` (available predefined as `LOVE_LANGUAGES`)
```
```if:haskell
The love languages are: `Words, Acts, Gifts, Time, Touch` ( available `Preloaded` as `LoveLanguage` )
```

Note: your partner may (and will) sometimes give a positive response to any love language ("false positive"), but the main one has a much higher possibility. On the other hand, you may get a neutral response even for the main language, but with a low possibility ("false negative").

There will be 50 tests. Although it's difficult to fail, in case you get unlucky, just run the tests again. After all, a few weeks may not be enough...

## Examples

```python
main love language: "words"

partner.response("words") ==> "positive"
partner.response("acts")  ==> "neutral"
partner.response("words") ==> "positive"
partner.response("time")  ==> "neutral"
partner.response("acts")  ==> "positive"    # false positive
partner.response("gifts") ==> "neutral"
partner.response("words") ==> "neutral"     # false negative
etc.
```

~~~if:haskell
## Notes

`Preloaded` exports the following:

~~~

Happy coding, and **DO** try this at home! :-)

---

## My other katas

If you enjoyed this kata then please try [my other katas](https://www.codewars.com/collections/katas-created-by-anter69)! :-)

#### *Translations are welcome!*

Difficulty: EASY

Starter code:
def love_language(partner, weeks):
	

Solutions:
import random

def love_language(partner, weeks):
	rst = [0, 0, 0, 0, 0]
	for i in range(0, weeks * 7):
		if partner.response(LOVE_LANGUAGES[i % 5]) == 'positive':
			rst[i % 5] += 1
	return LOVE_LANGUAGES[rst.index(max(rst))]


def love_language(partner, weeks):
	n = len(LOVE_LANGUAGES)
	count = [0] * n
	for i in range(0, weeks * 7):
		response = partner.response(LOVE_LANGUAGES[i % n])
		count[i % n] += 1 if response == 'positive' else 0
	return LOVE_LANGUAGES[count.index(max(count))]


def love_language(partner, weeks):
	return max(LOVE_LANGUAGES, key=lambda word: sum((partner.response(word) == 'positive' for _ in range(weeks))))


from collections import Counter

def love_language(partner, weeks):
	c = Counter()
	for i in range(7 * weeks // 5):
		for lang in ['words', 'acts', 'gifts', 'time', 'touch']:
			if partner.response(lang) == 'positive':
				c[lang] += 1
	return max(c, key=c.get)


def love_language(partner, weeks):
	d = {'words': 0, 'acts': 0, 'gifts': 0, 'time': 0, 'touch': 0}
	for w in range(weeks):
		for k in d.keys():
			if partner.response(k) == 'positive':
				d[k] += 1
	return max(d, key=d.get)


def love_language(p, w):
	return max(LOVE_LANGUAGES, key=lambda x: sorted(map(p.response, w * [x])))


def love_language(partner, weeks: int):
	import random
	for l in LOVE_LANGUAGES:
		random.seed(3)
		if partner.response(l) == 'positive':
			return l


import itertools as it

def love_language(partner, weeks):
	for lang in it.cycle(LOVE_LANGUAGES):
		if partner.response(lang) == 'positive':
			if partner.response(lang) == 'positive':
				if partner.response(lang) == 'positive':
					return lang


from collections import Counter
from itertools import cycle, islice
RESPONSE_POS = 'positive'
WEEK_LEN = 7

def love_language(partner, weeks):

	def positive(response):
		return response == RESPONSE_POS
	queries = islice(cycle(LOVE_LANGUAGES), weeks * WEEK_LEN)
	tests = ((query, partner.response(query)) for query in queries)
	stats = Counter((query for (query, response) in tests if positive(response)))
	[(winner, count)] = stats.most_common(1)
	return winner


from itertools import cycle
import operator

def love_language(partner, weeks):
	counts = {}
	for l in LOVE_LANGUAGES:
		counts[l] = 0
	for (lang, week) in zip(cycle(LOVE_LANGUAGES), range(weeks * 7)):
		counts[lang] += int(partner.response(lang) == 'positive')
	return max(counts.items(), key=operator.itemgetter(1))[0]