## Description
You are a *Fruit Ninja*, your skill is cutting fruit. All the fruit will be cut in half by your knife. For example:

```
[  "apple",     "pear",     "banana"  ]  --> ["app", "le", "pe", "ar", "ban", "ana"]
```
As you see, all fruits are cut in half. You should pay attention to `"apple"`: if you cannot cut a fruit into equal parts, then the first part will has a extra character.

You should only cut the fruit, other things **should not be cut**, such as the `"bomb"`:
```
[  "apple",     "pear",     "banana",   "bomb"]  -->
["app", "le", "pe", "ar", "ban", "ana", "bomb"]
```

The valid fruit names are preloded for you as:
```python
FRUIT_NAMES
```

## Task

```if:javascript
Complete function `cutFruits` that accepts argument `fruits`.
Returns the result in accordance with the rules above.
```
```if:ruby,python
Complete function `cut_fruits` that accepts argument `fruits`.
Returns the result in accordance with the rules above.
```
```if:haskell
Complete function cutFruits that accepts a String array/list.
Returns the result in accordance with the rules above.
```

OK, that's all. I guess this is a 7kyu kata. If you agree, please rank it as 7kyu and vote `very`;-) If you think this kata is too easy or too hard, please shame me by rank it as you want and vote `somewhat` or `none` :[

---

##### *[Click here](https://www.codewars.com/kata/search/?q=i+guess+this+is+a+kyu+kata)  for more more "I guess this is ...kyu" katas!*

Difficulty: EASY
Starter code: def cut_fruits(fruits):
	

Solutions:
FRUIT_NAMES = {'blueberry', 'pear', 'durian', 'ginkgo', 'peach', 'apple', 'cantaloupe', 'fig', 'mangosteen', 'watermelon', 'pineapple', 'cherry', 'pomegranate', 'carambola', 'hawthorn', 'persimmon', 'apricot', 'plum', 'litchi', 'mango', 'jujube', 'lemon', 'orange', 'tomato', 'banana', 'coconut', 'grape', 'pitaya'}

def cut(x):
	if x in FRUIT_NAMES:
		m = (len(x) + 1) // 2
		return [x[:m], x[m:]]
	return [x]

def cut_fruits(fruits):
	return [x for xs in map(cut, fruits) for x in xs]


FRUIT_NAMES = {'blueberry', 'pear', 'durian', 'ginkgo', 'peach', 'apple', 'cantaloupe', 'fig', 'mangosteen', 'watermelon', 'pineapple', 'cherry', 'pomegranate', 'carambola', 'hawthorn', 'persimmon', 'apricot', 'plum', 'litchi', 'mango', 'jujube', 'lemon', 'orange', 'tomato', 'banana', 'coconut', 'grape', 'pitaya'}
from itertools import chain

def cut_fruits(fruits):
	return list(chain(*map(cut, fruits)))

def cut(f):
	if f not in FRUIT_NAMES:
		yield f
	else:
		i = sum(divmod(len(f), 2))
		yield f[:i]
		yield f[i:]


FRUIT_NAMES = {'blueberry', 'pear', 'durian', 'ginkgo', 'peach', 'apple', 'cantaloupe', 'fig', 'mangosteen', 'watermelon', 'pineapple', 'cherry', 'pomegranate', 'carambola', 'hawthorn', 'persimmon', 'apricot', 'plum', 'litchi', 'mango', 'jujube', 'lemon', 'orange', 'tomato', 'banana', 'coconut', 'grape', 'pitaya'}
import math

def cut_fruits(fruits):
	cut_fruits = []
	for i in fruits:
		if i in FRUIT_NAMES:
			cut_fruits.extend([i[0:math.ceil(len(i) / 2)], i[math.ceil(len(i) / 2):]])
		else:
			cut_fruits.append(i)
	return cut_fruits


FRUIT_NAMES = {'blueberry', 'pear', 'durian', 'ginkgo', 'peach', 'apple', 'cantaloupe', 'fig', 'mangosteen', 'watermelon', 'pineapple', 'cherry', 'pomegranate', 'carambola', 'hawthorn', 'persimmon', 'apricot', 'plum', 'litchi', 'mango', 'jujube', 'lemon', 'orange', 'tomato', 'banana', 'coconut', 'grape', 'pitaya'}

def cut_fruits(fruits):
	result = []
	for item in fruits:
		if item in FRUIT_NAMES:
			l = len(item)
			m = sum(divmod(l, 2))
			result.extend((item[:m], item[m:]))
		else:
			result.append(item)
	return result


FRUIT_NAMES = {'blueberry', 'pear', 'durian', 'ginkgo', 'peach', 'apple', 'cantaloupe', 'fig', 'mangosteen', 'watermelon', 'pineapple', 'cherry', 'pomegranate', 'carambola', 'hawthorn', 'persimmon', 'apricot', 'plum', 'litchi', 'mango', 'jujube', 'lemon', 'orange', 'tomato', 'banana', 'coconut', 'grape', 'pitaya'}
F = {f: (f[:(len(f) + 1) // 2], f[(len(f) + 1) // 2:]) for f in FRUIT_NAMES}

def cut_fruits(fruits):
	return [e for t in [F.get(f, (f, '')) for f in fruits] for e in t if e]


FRUIT_NAMES = {'blueberry', 'pear', 'durian', 'ginkgo', 'peach', 'apple', 'cantaloupe', 'fig', 'mangosteen', 'watermelon', 'pineapple', 'cherry', 'pomegranate', 'carambola', 'hawthorn', 'persimmon', 'apricot', 'plum', 'litchi', 'mango', 'jujube', 'lemon', 'orange', 'tomato', 'banana', 'coconut', 'grape', 'pitaya'}
cut_fruits = lambda f, c=__import__('math').ceil, l=[]: l.clear() or (f and [l.extend([e[:c(len(e) / 2)], e[c(len(e) / 2):]]) if e in FRUIT_NAMES else l.append(e) for e in f][0]) or l


FRUIT_NAMES = {'blueberry', 'pear', 'durian', 'ginkgo', 'peach', 'apple', 'cantaloupe', 'fig', 'mangosteen', 'watermelon', 'pineapple', 'cherry', 'pomegranate', 'carambola', 'hawthorn', 'persimmon', 'apricot', 'plum', 'litchi', 'mango', 'jujube', 'lemon', 'orange', 'tomato', 'banana', 'coconut', 'grape', 'pitaya'}
from itertools import *
from math import *

def cut_fruits(fruits):

	def half(f):
		return [f[0:ceil(len(f) / 2)], f[ceil(len(f) / 2):]] if f in FRUIT_NAMES else [f]
	return list(chain(*[half(f) for f in fruits]))


FRUIT_NAMES = {'blueberry', 'pear', 'durian', 'ginkgo', 'peach', 'apple', 'cantaloupe', 'fig', 'mangosteen', 'watermelon', 'pineapple', 'cherry', 'pomegranate', 'carambola', 'hawthorn', 'persimmon', 'apricot', 'plum', 'litchi', 'mango', 'jujube', 'lemon', 'orange', 'tomato', 'banana', 'coconut', 'grape', 'pitaya'}

def cut_fruits(fruits):
	result = list()
	for val in fruits:
		if val in FRUIT_NAMES:
			if len(val) % 2 == 0:
				re = int(len(val) / 2)
				result.append(val[:re])
				result.append(val[re:])
			else:
				re = int(len(val) / 2)
				result.append(val[:re + 1])
				result.append(val[re + 1:])
		else:
			result.append(val)
	return result