sometimes you need to limit array result to use such as you only need the value over 10 or you need value under than 100 by use this algorithms you can limit your array to specific value if array min max value was given it returns array that contains values of given array which was larger than min and lower than max you need to give unlimit to use only min or max ex limit1 2 3 4 5 none 3 1 2 3 complexity on tl dr array slicing by value tl dr array slicing by value
def limit(arr, min_lim=None, max_lim=None):
    if len(arr) == 0:
        return arr

    if min_lim is None:
        min_lim = min(arr)
    if max_lim is None:
        max_lim = max(arr)

    return list(filter(lambda x: (min_lim <= x <= max_lim), arr))