#https://www.codewars.com/kata/find-the-middle-element
#7 Kyu earned
#As a part of this Kata, you need to create a function that when provided with a triplet, returns the index of the numerical element that lies between the other two elements.  The input to the function will be an array of three distinct numbers (Haskell: a tuple).  
#For example:  gimme([2, 3, 1]) => 0.  2 is the number that fits between 1 and 3 and the index of 2 in the input array is 0.
#gimme([5, 10, 14]) => 1.  10 is the number that fits between 5 and 14 and the index of 10 in the input array is 1.
from statistics import median
inputthreenumbers = [2, 3, 1]
print(median(inputthreenumbers)) #print 2
print(inputthreenumbers.index(median(inputthreenumbers))) #print 0

from statistics import median
def gimme(input_array):
	return input_array.index(median(input_array))
print(gimme([2, 3, 1])) #print 0
print(gimme([5, 10, 14])) #print 1