def minmax(array):
    """Find both min and max value of arr in one pass"""
    minval = maxval = array[0]

    for e in array[1:]:
        if e < minval:
            minval = e
        if e > maxval:
            maxval = e

    return minval, maxval