def detected(numbers, mode):
    """
    Returns a Boolean result indicating whether the last member in a numeric array is the max or
    min, depending on the setting.

    Arguments
      - numbers: an array of numbers
      - mode: 'max' or 'min'
    """
    call_dict = {'min': min, 'max': max}
    if mode not in call_dict.keys():
        print('Must specify either max or min')
        return
    return numbers[-1] == call_dict[mode](numbers)