# Task
Consider an array of integers `a`. Let `min(a)` be its minimal element, and let `avg(a)` be its mean.

Define the center of the array `a` as array `b` such that:

```
- b is formed from a by erasing some of its elements.
- For each i, |b[i] - avg(a)| < min(a).
- b has the maximum number of elements among all the arrays
  satisfying the above requirements.
```

Given an array of integers, return its center.



# Input/Output


`[input]` integer array `a`

 Unsorted non-empty array of integers.

`2 ≤ a.length ≤ 50,`

`1 ≤ a[i] ≤ 350.`

`[output]` an integer array


# Example

For `a = [8, 3, 4, 5, 2, 8]`, the output should be `[4, 5]`.

Here `min(a) = 2, avg(a) = 5`.

For `a = [1, 3, 2, 1]`, the output should be `[1, 2, 1]`.

Here `min(a) = 1, avg(a) = 1.75`.

Difficulty: introductory

Starter code:

def array_center(arr):
	

Solutions:
def array_center(lst):
    return [i for i in lst if abs(i - sum(lst)*1.0/len(lst)) < min(lst)]

from statistics import mean

def array_center(arr):
    low, avg = min(arr), mean(arr)
    return [b for b in arr if abs(b - avg) < low]

from statistics import mean

def array_center(a):
    n, m = min(a), mean(a)
    return [x for x in a if abs(x - m) < n]

def array_center(arr):
    m, a = min(arr), (sum(arr) / len(arr))
    return [n for n in arr if abs(n - a) < m]


def array_center(arr):
    avg = sum(arr)/len(arr)
    return [i for i in arr if abs(i - avg) < min(arr)]



def array_center(arr):
    #your code here
    a = min(arr)
    c = []
    b = 0
    for i in arr:
        b = b + i
    aver = b / len(arr)
    for i in arr:
        if abs(i - aver) < a:
            c.append(i)
    return c

def array_center(a):
    mi, me = min(a), sum(a)/len(a)
    return [x for x in a if abs(x-me) < mi]

array_center=lambda a:[n for n in a if abs(n-sum(a)/len(a))<min(a)]

from numpy import mean
def array_center(arr):
    m,a=min(arr),mean(arr)
    return list(filter(lambda n:abs(n-a)<m,arr))

from statistics import mean
def array_center(a):
    m, avg = min(a), mean(a)
    return [i for i in a if -m<(i-avg)<m]