def partition(A, p, r):
    q = j = p
    while j < r:
        if A[j] <= A[r]:
            A[q], A[j] = A[j], A[q]
        q += 1
    j += 1
    A[q], A[r] = A[r], A[q]
    return q

def quicksort(A, p, r):
    if r <= p:
        return
    q = partition(A, p, r)
    quicksort(A, p, q - 1)
    quicksort(A, q + 1, r)


def partition(A, p, r):
    q = j = p
    while j < r:
        if A[j] <= A[r]:
            A[q], A[j] = A[j], A[q]
        q += 1
        j += 1
    A[q], A[r] = A[r], A[q]
    return q

def quicksort(A, p, r):
    if r <= p:
        return
    q = partition(A, p, r)
    quicksort(A, p, q - 1)
    quicksort(A, q + 1, r)

Sort a list by recursively partitionioning list until sorted.


def reverse_list(a):
    return reverse_list(a[1:]) + a[0]

Recursively reverse a list of elements.


def partition(A, p, r):
    q = j = p
    while j < r:
        if A[j] <= A[r]:
            A[q], A[j] = A[j], A[q]
            q += 1
        j += 1
    A[q], A[r] = A[r], A[q]
    return q

def quicksort(A, p, r):
    if r <= p:
        return
    q = partition(A, p, r)
    quicksort(A, p, q - 1)
    quicksort(A, q + 1, r)


def fibonacci(n):
    if n <= 1:
        return 1
    return fibonacci(n - 2) + fibonacci(n - 1)

assert fibonacci(0)==0 and fibonacci(1)==1 and fibonacci(2)==1 and fibonacci(10)==55 and fibonacci(23)==28657

Recursively compute the value of the fibonacci series at position n.


def reverse_list(a):
    return reverse_list(a[1:]) + [a[0]]

Recursively reverse a list of elements.


def selectionsort(a):
    i = 0
    while i < len(a):
        p = i
        j = i + 1
        while j < len(a):
            if a[j] < a[p]:
                p = j
            j = j + 1
    tmp = a[p]
    a[p] = a[i]
    a[i] = tmp
    i = i + 1

assert selectionsort([])==None and selectionsort([])==None and selectionsort([0])==None and selectionsort([0])==None

Sort a list by repeatedly move minimimum of remaining sublist to front.


def selectionsort(a):
    i = 0
    while i < len(a):
        p = i
        j = i + 1
        while j < len(a):
            if a[j] < a[p]:
                p = j
            j = j + 1
        tmp = a[p]
        a[p] = a[i]
        a[i] = tmp
        i = i + 1


def reverse_list(s):
    if len(s) == 0:
        return []
    else:
        return [s[-1]] + reverse_list(s[:-1])

Recursively reverse a list of elements.


Recursively reverse a list of elements.


def reverse_list(l, i=None):
    if i is None:
        i = len(l) - 1
    if i > 0:
        return reverse_list(l[1:] + [l[0]], i - 1)
    else:
        return l

Recursively reverse a list of elements.


def reverse_list(l, i=None):
    if i is None:
        i = len(l) - 1
    if i >= 0:
        return reverse_list(l[1:] + [l[0]], i - 1)
    else:
        return l

Recursively reverse a list of elements.


def reverse_list(l, i=None):
    if i is None:
        i = len(l)
    if i > 0:
        return reverse_list(l[1:] + [l[0]], i - 1)
    else:
        return l

Recursively reverse a list of elements.


def reverse_list(l, i=None):
    if i is None:
        i = len(l) // 2
    if i > 0:
        return reverse_list(l[1:] + [l[0]], i - 1)
    else:
        return l

Recursively reverse a list of elements.


def reverse_list(l, i=None):
    if i is None:
        i = len(l) // 2
    if i >= 0:
        return reverse_list(l[1:] + [l[0]], i - 1)
    else:
        return l

Recursively reverse a list of elements.


def count_letters(s):
    if s == ' ':
        return 0
    else:
        return 1 + count_letters(s[1:])

assert count_letters('')==0 and count_letters('0')==1 and count_letters('##')==2 and count_letters('t')==1 and count_letters('fqfseqfseqsse')==13

Return the number of lettres in a string.


def selectionsort(A):
    i = 0
    while i < len(A) - 1:
        p = i
        j = i + 1
        while j < len(A):
            if A[j] < A[p]:
                p = j
            j += 1
        tmp = A[p]
        A[p] = A[i]
        A[i] = tmp
        i += 1


def count_letters(s):
    if s == '':
        return 0
    else:
        return 1 + count_letters(s[1:])


def power(m, n):
    if n == 0:
        return 1
    elif n == 1:
        return m
    else:
        return m * power(m, n - 1)

Raise m to the power of n.


Raise m to the power of n.


def reverse_list(l, i=0):
    if i < len(l) // 2:
        l[i], l[-i - 1] = l[-i - 1], l[i]
        return reverse_list(l, i + 1)
    else:
        return l

Recursively reverse a list of elements.


def lowest(first, rest):
    if len(rest) == 0:
        return first
    if first > rest[0] or first < 0:
        return lowest(rest[0], rest[1:])
    else:
        return lowest(first, rest[1:])

def minimum(l):

    def lowest(first, rest):
        if len(rest) == 0:
            return first
        if first > rest[0] or first < 0:
            return lowest(rest[0], rest[1:])
        else:
            return lowest(first, rest[1:])
    return lowest(l[0], l[1:])

Return the minimum element in a list of numbers.


def lowest(first, rest):
    if len(rest) == 0:
        return first
    if first > rest[0] or first <= 0:
        return lowest(rest[0], rest[1:])
    else:
        return lowest(first, rest[1:])

def minimum(l):

    def lowest(first, rest):
        if len(rest) == 0:
            return first
        if first > rest[0] or first <= 0:
            return lowest(rest[0], rest[1:])
        else:
            return lowest(first, rest[1:])
    return lowest(l[0], l[1:])


def lowest(first, rest):
    if len(rest) == 0:
        return first
    if first > rest[0] or first < 0:
        return lowest(rest[0], rest[1:])
    else:
        return lowest(first, rest[1:])

def minimum(l=None):
    if l == None:
        l = []

    def lowest(first, rest):
        if len(rest) == 0:
            return first
        if first > rest[0] or first < 0:
            return lowest(rest[0], rest[1:])
        else:
            return lowest(first, rest[1:])
    return lowest(l[0], l[1:])


def lowest(first, rest):
    if len(rest) == 0:
        return first
    elif first > rest[0] or first < 0:
        return lowest(rest[0], rest[1:])
    else:
        return lowest(first, rest[1:])

def minimum(l=None):
    if l == None:
        l = []

    def lowest(first, rest):
        if len(rest) == 0:
            return first
        elif first > rest[0] or first < 0:
            return lowest(rest[0], rest[1:])
        else:
            return lowest(first, rest[1:])
    return lowest(l[0], l[1:])


def selectionsort(a):
    i = 0
    p = 0
    while i < len(a):
        p = i
        j = i + 1
        while j < len(a):
            if a[j] < a[p]:
                p = j
            j = j + 1
        tmp = a[p]
        a[p] = a[i]
        a[i] = tmp
        i = i + 1
    return a


def minimum(l, current_min=None):
    if not l:
        return current_min
    first = l.pop()
    if current_min == None or first < current_min:
        return minimum(l, first)
    return minimum(l, current_min)


def maximum(l, current_max=None):
    if not l:
        return current_max
    first = l.pop()
    if current_max == None or first > current_max:
        return maximum(l, first)
    return maximum(l, current_max)

Return the maximum element in a list of numbers.


def power(m, n):
    if n == 0:
        return 1
    return m * power(m, n - 1)

Raise m to the power of n.


def count_letters(s):
    if s == '':
        return 0
    return 1 + count_letters(s[1:])


def partition(A, p, r):
    q = j = p
    while j < r:
        if A[j] <= A[r]:
            A[q], A[j] = A[j], A[q]
            q += 1
        j += 1
    A[q], A[r] = A[r], A[q]
    return q

def quicksort(A, p, r):
    if r <= p:
        return
    q = partition(A, p, r)
    quicksort(A, p, q - 1)
    quicksort(A, p + 1, r)


def reverse_list(l):
    if l == []:
        return l
    return l[-1:] + reverse_list(l[:-1])

Recursively reverse a list of elements.


Recursively reverse a list of elements.


def partition(A, p, r):
    q = j = p
    while j < r:
        if A[j] <= A[r]:
            A[q], A[j] = A[j], A[q]
            q += 1
        j += 1
    A[q], A[r] = A[r], A[q]
    return q

def quicksort(A, p, r):
    if r <= p:
        print(0)
    q = partition(A, p, r)
    quicksort(A, p, q - 1)
    quicksort(A, p + 1, r)


def partition(A, p, r):
    q = j = p
    while j < r:
        if A[j] <= A[r]:
            A[q], A[j] = A[j], A[q]
            q += 1
        j += 1
    A[q], A[r] = A[r], A[q]
    return q

def quicksort(A, p, r):
    if r <= p:
        return None
    q = partition(A, p, r)
    quicksort(A, p, q - 1)
    quicksort(A, p + 1, r)


def partition(A, p, r):
    q = j = p
    while j < r:
        if A[j] <= A[r]:
            A[q], A[j] = A[j], A[q]
            q += 1
        j += 1
    A[q], A[r] = A[r], A[q]
    return q

def quicksort(A, p, r):
    if r <= p:
        return 1
    q = partition(A, p, r)
    quicksort(A, p, q - 1)
    quicksort(A, p + 1, r)


def fibonacci(n):
    if n == 0:
        return 1
    elif n == 1:
        return n
    else:
        return fibonacci(n - 1) + fibonacci(n - 2)


def minimum(a):
    if len(a) == 1:
        return a[0]
    if a[0] < a[1]:
        a.remove(a[1])
    else:
        a.remove(a[0])
    return minimum(a)


def reverse_list(a):
    if len(a) == 1:
        return []
    else:
        return [a[-1]] + reverse_list(a[:-1])

Recursively reverse a list of elements.


def maximum(a):
    if len(a) == 1:
        return a[0]
    if a[0] > a[1]:
        a.remove(a[1])
    else:
        a.remove(a[0])
    return maximum(a)


def reverse_list(a):
    if len(a) == 0:
        return []
    else:
        return [a[-1]] + reverse_list(a[:-1])

Recursively reverse a list of elements.


def partition(A, p, r):
    q = j = p
    while j < r:
        if A[j] <= A[r]:
            A[q], A[j] = A[j], A[q]
            q += 1
        j += 1
    A[q], A[r] = A[r], A[q]
    return q

def quicksort(A):

    def partition(A, p, r):
        q = j = p
        while j < r:
            if A[j] <= A[r]:
                A[q], A[j] = A[j], A[q]
                q += 1
            j += 1
        A[q], A[r] = A[r], A[q]
        return q
    q = partition(A, p, r)
    quicksort(A, p, q - 1)
    quicksort(A, q + 1, r)


def partition(A, p, r):
    q = j = p
    while j < r:
        if A[j] <= A[r]:
            A[q], A[j] = A[j], A[q]
            q += 1
        j += 1
    A[q], A[r] = A[r], A[q]
    return q

def quicksort(A, p, r):

    def partition(A, p, r):
        q = j = p
        while j < r:
            if A[j] <= A[r]:
                A[q], A[j] = A[j], A[q]
                q += 1
            j += 1
        A[q], A[r] = A[r], A[q]
        return q
    q = partition(A, p, r)
    quicksort(A, p, q - 1)
    quicksort(A, q + 1, r)


def minimum(s):
    if len(s) == 1:
        return 0
    else:
        max = maxElement(L[1:])
        if L[0] > max:
            return L[0]
        else:
            return max


def partition(A, p, r):
    q = j = p
    while j < r:
        if A[j] <= A[r]:
            A[q], A[j] = A[j], A[q]
            q += 1
        j += 1
    A[q], A[r] = A[r], A[q]
    return q

def quicksort(A, p, r):

    def partition(A, p, r):
        q = j = p
        while j < r:
            if A[j] <= A[r]:
                A[q], A[j] = A[j], A[q]
                q += 1
            j += 1
        A[q], A[r] = A[r], A[q]
        return q
    if r <= p:
        return
    q = partition(A, p, r)
    quicksort(A, p, q - 1)
    quicksort(A, q + 1, r)


def count_letters(s):
    if s == ' ':
        return 0
    return 1 + count_letters(s)


def minimum(s):
    if n == 1:
        return s[0]
    else:
        min = minimum(s[1:], n - 1)
        if s[0] < min:
            return s[0]
        else:
            return min


def minimum(s):
    if s == 1:
        return s[0]
    else:
        min = minimum(s[1:], s - 1)
        if s[0] < min:
            return s[0]
        else:
            return min


def count_letters(s):
    if s == '':
        return 0
    return 1 + count_letters(s[1:])


def selectionsort(A):
    i = 0
    while i < len(A):
        j = i + 1
        while j < len(A):
            if A[j] < A[i]:
                A[j], A[i] = A[i], A[j]
            j += 1
        i += 1
    return A


def minimum(s):
    if len(s) == 0:
        return 0
    else:
        min_ret = minimum(l[1:])
        return l[0] if l[0] < min_ret else min_ret


def minimum(s):
    if len(s) == 0:
        return 0
    else:
        min_ret = minimum(s[1:])
        return s[0] if s[0] < min_ret else min_ret


def minimum(s):
    if len(s) == 1:
        return 0
    else:
        min_ret = minimum(s[1:])
        return s[0] if s[0] < min_ret else min_ret


def reverse_list(a):
    m = a[::-1]
    return m

Recursively reverse a list of elements.


def partition(A, p, r):
    q = j = p
    while j < r:
        if A[j] <= A[r]:
            A[q], A[j] = A[j], A[q]
            q += 1
        j += 1
    A[q], A[r] = A[r], A[q]
    return q

def quicksort(A, p, r):
    if r <= p:
        return
    q = partition(A, p, r)
    quicksort(A, p, q - 1)
    quicksort(A, p + 1, r)


Recursively reverse a list of elements.


def selectionsort(A):
    i = 0
    while i < len(A):
        p = i
        j = i + 1
        while j < len(A):
            if A[j] < A[p]:
                p = j
            j = j + 1
        tmp = A[p]
        A[p] = A[i]
        A[i] = tmp
        return A
        i = i + 1


def selectionsort(A):
    i = 0
    while i < len(A):
        p = i
        j = i + 1
        while j < len(A):
            if A[j] < A[p]:
                p = j
            j = j + 1
        tmp = A[p]
        A[p] = A[i]
        A[i] = tmp
        i = i + 1
        return A


def fibonacci(n):
    if n == 0 or n == 1:
        return 1
    else:
        return fibonacci(n - 1) + fobonacci(n - 2)


def fibonacci(n):
    if n == 0 or n == 1:
        return 1
    else:
        return fibonacci(n - 1) + fibonacci(n - 2)


def selectionsort(A):
    i = 0
    while i < len(A):
        p = i
        j = i + 1
        while j < len(A):
            if A[j] < A[p]:
                p = j
            j = j + 1
        tmp = A[p]
        A[p] = A[i]
        A[i] = tmp
        i = i + 1


def minimum(s):
    if len(s) == 1:
        return s[0]
    else:
        min_ret = minimum(s[1:])
        return s[0] if s[0] < min_ret else min_ret


def quicksort(A, p, r):
    print(len(A))


def partition(A, p, r):
    q = j = p
    while j < r:
        if A[j] <= A[r]:
            A[q], A[j] = A[j], A[q]
            q += 1
        j += 1
    A[q], A[r] = A[r], A[q]
    return q

def quicksort(A, p, r):
    if r <= p:
        return
    q = partition(A, p, r)
    quicksort(A, p, r - 1)
    quicksort(A, p + 1, r)


def partition(A, p, r):
    q = j = p
    while j < r:
        if A[j] <= A[r]:
            A[q], A[j] = A[j], A[q]
            q += 1
        j += 1
    A[q], A[r] = A[r], A[q]
    return q

def quicksort(A, p, r):
    if r <= p:
        return
    q = partition(A, p, r)
    quicksort(A, p, q - 1)
    quicksort(A, q + 1, r)


def selectionsort(a):
    i = 0
    while i < len(a):
        p = i
        j = i + 1
        while j < len(a):
            if a[j] < a[p]:
                p = j
            j = j + 1
        tmp = a[p]
        a[p] = a[i]
        a[i] = tmp
        i = i + 1


Raise m to the power of n.


def minimum(a):
    a_sorted = sorted(a)
    return a


def maximum(a):
    return sorted(a)[-1]


def count_letters(s):
    total = 0
    for x in s:
        total += 1
    return total


def maximum(s):
    if len(s) == 1:
        return s[0]
    else:
        maxi = maximum(s[1:])
        return l[0] if l[0] > maxi else maxi


def maximum(s):
    if len(s) == 1:
        return s[0]
    else:
        maxi = maximum(s[1:])
        return s[0] if s[0] > maxi else maxi


def fibonacci(n):
    if n == 0:
        return 0
    elif n == 1:
        return 1
    else:
        return fibonacci(n - 1) + fibonacci(n - 2)


def partition(A, p, r):
    q = j = p
    while j < r:
        if A[j] <= A[r]:
            A[q], A[j] = A[j], A[q]
            q += 1
        j += 1
    A[q], A[r] = A[r], A[q]
    return q

def quicksort(A, p, r):
    if r <= p:
        return
    q = partition(A, p, r)
    quicksort(A, p, q - 1)
    quicksort(A, p + 1, r)


def partition(a, p, r):
    q = j = p
    while j < r:
        if a[j] <= a[r]:
            a[q], a[j] = a[j], a[q]
            q += 1
        j += 1
    a[q], a[r] = a[r], a[q]
    return q

def quicksort(a, p, r):
    if r <= p:
        return
    q = partition(a, p, r)
    quicksort(a, p, q - 1)
    quicksort(a, q + 1, r)


def quicksort(l, beg, fin):
    if fin - beg < 1:
        return
    i = j = beg
    while i <= fin:
        if l[i] <= l[fin]:
            l[i], l[j] = l[j], l[i]
            j += 1
        i += 1
    quicksort(l, beg, j - 2)
    quicksort(l, j, fin)


def selectionsort(A):
    for i in range(len(A)):
        min_j = i
        for j in range(i, len(A)):
            if A[j] < A[min_j]:
                min_j = j
        A[i], A[min_j] = A[min_j], A[i]


def selectionsort(a):
    i = 0
    while i < len(a):
        p = i
        j = i + 1
        while j < len(a):
            if a[j] < a[p]:
                p = j
            j += 1
        tmp = a[p]
        a[p] = a[i]
        a[i] = tmp
        i += 1


def selectionsort(a):
    i = 0
    while i < len(a):
        p = i
        j = i + 1
        while j < len(a):
            if a[j] < a[p]:
                p = j
            j = j + 1
        tmp = a[p]
        a[p] = a[i]
        a[i] = tmp
        i = i + 1
    return a


def minimum(l):
    if len(l) == 1:
        return l[0]
    else:
        minv = minimum(l[1:])
        return l[0] if l[0] < minv else minv


def maximum(l):
    if len(l) == 1:
        return l[0]
    else:
        maxv = maximum(l[1:])
        return l[0] if l[0] > maxv else maxv


def count_letters(s):
    if s == '':
        return 0
    else:
        return 1 + count_letters(s[1:])


def selectionsort(l):
    i = 0
    while i < len(l):
        p = i
        j = i + 1
        while j < len(a):
            if a[j] < a[p]:
                p = j
            j += 1
        tmp = a[p]
        a[p] = a[i]
        a[i] = tmp
        i += 1


def reverse_list(l):
    if len(l) == 0:
        return []
    else:
        return l[-1].append(reverse_list(s[:-1]))

Recursively reverse a list of elements.


def reverse_list(l):
    if len(l) == 0:
        return []
    else:
        return [l[-1]].append(reverse_list(s[:-1]))

Recursively reverse a list of elements.


def reverse_list(l):
    if len(l) == 0:
        return []
    else:
        return [l[-1]].append(reverse_list(l[:-1]))

Recursively reverse a list of elements.


def reverse_list(l):
    if len(l) == 0:
        return []
    else:
        return [l[-1]] + reverse_list(l[:-1])

Recursively reverse a list of elements.


Recursively reverse a list of elements.


def fibonacci(n):
    if n <= 1:
        return 1
    else:
        return fibonacci(n - 1) + fibonacci(n - 2)


def minimum(ints):
    if len(ints) == 1:
        return ints[0]
    elif ints[0] > ints[1]:
        ints.remove(ints[0])
    else:
        ints.remove(ints[1])
    return minimum(ints)


def maximum(ints):
    if len(ints) == 1:
        return ints[0]
    elif ints[0] < ints[1]:
        ints.remove(ints[0])
    else:
        ints.remove(ints[1])
    return maximum(ints)


def count_letters(string, count=0):
    if string == '':
        return count
    else:
        string = string[1:]
    return count_letters(string, count + 1)


def reverse_list(l, reverse=None):
    if reverse is None:
        reverse = []
    if not l:
        return reverse
    else:
        reverse.append(l[-1])
        l.remove(l[-1])
    return reverse_list(l, reverse)

Recursively reverse a list of elements.


def quicksort(A, p, r):
    if r <= p:
        return
    q = partition(A, p, r)
    quicksort(A, p, q - 1)
    quicksort(A, q + 1, r)


def partition(a, p, r):
    q = j = p
    while j < r:
        if a[j] < a[r]:
            a[q], a[j] = a[j], a[q]
            q += 1
        j += 1
    a[q], a[r] = a[r], a[q]
    return q

def quicksort(A, p, r):
    if r <= p:
        return
    q = partition(A, p, r)
    quicksort(A, p, q - 1)
    quicksort(A, q + 1, r)


def selectionsort(a):
    for done in range(len(a) - 1):
        min_value = a[done]
        min_index = done
        for i in range(done + 1, len(a)):
            if a[i] < min_value:
                min_value = a[i]
                min_index = i
        a[min_index], a[done] = a[done], a[min_index]


def quicksort(l, beg, fin):
    if fin - beg < 1:
        return
    i = j = beg
    while i <= fin:
        if l[i] <= l[fin]:
            l[i], l[j] = l[j], l[i]
            j += 1
        i += 1
    quicksort(l, beg, j - 2)
    quicksort(l, j, fin)


def selectionsort(A):
    for i in range(len(A)):
        min_j = i
        for j in range(i, len(A)):
            if A[j] < A[min_j]:
                min_j = j
            A[i], A[min_j] = A[min_j], A[i]


def selectionsort(A):
    for i in range(len(A)):
        min_j = i
        for j in range(i, len(A)):
            if A[j] < A[min_j]:
                min_j = j
        A[i], A[min_j] = A[min_j], A[i]


def power(n, p):
    if p == 0:
        return 1
    return n * power(n, p - 1)

Raise m to the power of n.


Raise m to the power of n.


def minimum(l, c=None):
    if c == None:
        return minimum(l[1:], l[0])
    if l == []:
        return c
    if l[0] < c:
        return minimum(l[1:], l[0])
    else:
        return minimum(l[1:], c)


def maximum(l, c=None):
    if c == None:
        return minimum(l[1:], l[0])
    if l == []:
        return c
    if l[0] > c:
        return minimum(l[1:], l[0])
    else:
        return minimum(l[1:], c)


def maximum(l, c=None):
    if c == None:
        return maximum(l[1:], l[0])
    if l == []:
        return c
    if l[0] > c:
        return maximum(l[1:], l[0])
    else:
        return maximum(l[1:], c)


def count_letters(word, current=0):
    if word == '':
        return current
    return count_letters(word[1:], current=current + 1)


def power(m, n):
    if n == 1:
        return m
    else:
        return m * power(m, n - 1)

Raise m to the power of n.


def power(m, n):
    if n == 0:
        return 1
    else:
        return m * power(m, n - 1)

Raise m to the power of n.


def reverse_list(l, n=None):
    if l == []:
        return n
    if n == None:
        return reverse_list(l[:-1], [l[-1]])
    return reverse_list(l[:-1], n + [l[-1]])

Recursively reverse a list of elements.


def reverse_list(l):
    if len(l) == 0:
        return []
    return [l[-1]] + reverse_list(l[:-1])

Recursively reverse a list of elements.


Recursively reverse a list of elements.


def minimum(l):
    a = l[len(l)]
    if len(a) == 1:
        return l[0]
    if a >= minimum(l):
        return minimum([j for j in l[:-1]])


def minimum(l):
    a = l[len(l) - 1]
    if len(a) == 1:
        return l[0]
    if a >= minimum(l):
        return minimum([j for j in l[:-1]])


def minimum(l):
    a = l[len(l) - 1]
    if len(l) == 1:
        return l[0]
    if a >= minimum(l):
        return minimum([j for j in l[:-1]])


def minimum(l):
    a = l[len(l) - 1]
    if len(l) == 1:
        return l[0]
    if a >= minimum(l[:-1]):
        return minimum(l[-1])


def minimum(l):
    a = l[0]
    if len(l) == 1:
        return l[0]
    if a >= minimum(l[:-1]):
        return minimum(l[:-1])


def minimum(l):
    a = l[0]
    if len(l) == 2:
        if l[1] >= l[0]:
            return l[0]
        else:
            return l[1]
    if a >= minimum(l[:-1]):
        return minimum(l[:-1])


def minimum(l):
    a = l[0]
    if len(l) == 1:
        return l[0]
    elif a >= minimum(l):
        return minimum(l[:-1])


def minimum(l):
    if len(l) == 1:
        return l[0]
    else:
        for i in l:
            if i >= minimum(l[1:]):
                return minimum(l[1:])


def minimum(l):
    if len(l) == 1:
        return l[0]
    if minimum(l[:-1]) >= minimum(l[1:]):
        return minimum(l[1:])
    else:
        return minimum(l[:-1])


def maximum(l):
    if len(l) == 1:
        return l[0]
    if maximum(l[:-1]) >= maximum(l[1:]):
        return maximum(l[:-1])
    else:
        return maximum(l[1:])


def count_letters(s):
    if s == '':
        return 0
    return 1 + count_letters(s[1:])


def reverse_list(l):
    if len(l) == 2:
        return l[1] + l[0]
    else:
        return reverse_list(l[1:]) + l[0]

Recursively reverse a list of elements.


def reverse_list(l):
    if len(l) == 2:
        return list(''.join(l[1], l[0]))
    else:
        return list(''.join(reverse_list(l[1:]), l[0]))

Recursively reverse a list of elements.


def reverse_list(l):
    if len(l) == 2:
        return ''.join(l[1], l[0]).split()
    else:
        return ''.join(reverse_list(l[1]), l[0]).split()

Recursively reverse a list of elements.


def reverse_list(l):
    if len(l) == 2:
        return ' '.join(l[1], l[0]).split(' ')
    else:
        return ''.join(reverse_list(l[1]), l[0]).split()

Recursively reverse a list of elements.


def reverse_list(l):
    if len(l) == 2:
        return l[1].append(l[0])
    return reverse_list(l[1:]).append(l[0])

Recursively reverse a list of elements.


def reverse_list(l):
    if len(l) == 2:
        a = []
        a.append(l[1])
        a.append(l[0])
        return a
    return reverse_list(l[1:]).append(l[0])

Recursively reverse a list of elements.


def reverse_list(l):
    if len(l) == 0:
        return []
    return reverse_list(l).append(l[:-1])

Recursively reverse a list of elements.


def reverse_list(l):
    if len(l) == 0:
        return []
    return reverse_list(l).append(l[0])

Recursively reverse a list of elements.


def reverse_list(l):
    if len(l) == 0:
        return []
    return reverse_list(l[1:]).append(l[0])

Recursively reverse a list of elements.


def reverse_list(l):
    if len(l) == 0:
        return []
    else:
        return reverse_list(l[1:]).append(l[0])

Recursively reverse a list of elements.


def reverse_list(l):
    if len(l) == 0:
        return []
    elif len(l) == 1:
        return l[0]
    else:
        return reverse_list(l[1:]).append(l[0])

Recursively reverse a list of elements.


def reverse_list(l):
    if len(l) == 0:
        return []
    elif len(l) == 1:
        return reverse_list(l[1:]).append(l[0])
    else:
        return reverse_list(l[1:]).append(l[0])

Recursively reverse a list of elements.


def fibonacci(n):
    if n == 1 or n == 1:
        return 1
    else:
        return fibonacci(n - 2) + fibonacci(n - 1)


def fibonacci(n):
    if n == 1 or n == 0:
        return 1
    else:
        return fibonacci(n - 2) + fibonacci(n - 1)


def selectionsort(a):
    i = 0
    while i < len(a):
        j = i + 1
        p = i
        while j < len(a):
            if a[p] >= a[j]:
                p = j
            j += 1
        tmp = a[i]
        a[i] = a[p]
        a[p] = tmp
        i += 1


def partition(A, p, r):
    q = j = p
    while j < r:
        if A[j] <= A[r]:
            A[q], A[j] = A[j], A[q]
            q += 1
        j += 1
    A[q], A[r] = A[r], A[q]
    return q

def quicksort(A, p, r):
    if r <= p:
        return
    q = partition(A, p, r)
    quicksort(A, p, q - 1)
    quicksort(A, q + 1, r)


Raise m to the power of n.


def minimum(list_1):
    i = 0
    total = '1000000'
    while i < len(list_1):
        if int(list_1[i]) <= int(total):
            total = list_1[i]
        else:
            0
        i = i + 1
    return total


def maximum(list_1):
    i = 0
    total = 0
    while i < len(list_1):
        if int(list_1[i]) >= int(total):
            total = list_1[i]
        else:
            0
        i = i + 1
    return total


def count_letters(string):
    return len(string)


def reverse_list(list_1):
    return list_1[::1]

Recursively reverse a list of elements.


def reverse_list(list_1):
    return list_1[::-1]

Recursively reverse a list of elements.


Recursively reverse a list of elements.


def fibonacci(n):
    if n == 1 or n == 0:
        return 1
    return fibonacci(n - 1) + fibonacci(n - 2)


def fibonacci(pos):
    import sys
    prev = 0
    curr = 1
    i = 0
    if pos == 0:
        return 1
    else:
        while i < pos + 1:
            curr = prev + curr
            prev = curr - prev
            i = i + 1
        return prev


def selectionsort(a):
    i = 0
    while i < len(a):
        p = i
        j = i + 1
        while j < len(a):
            if a[j] < a[p]:
                p = j
            j += 1
        tmp = a[p]
        a[p] = a[i]
        a[i] = tmp
        i += 1


def partition(a, p, r):
    q = j = p
    while j < r:
        if a[j] < a[r]:
            a[q], a[j] = a[j], a[q]
            q += 1
        j += 1
    a[q], a[r] = a[r], a[q]
    return q

def quicksort(A, p, r):
    if r <= p:
        return
    q = partition(A, p, r)
    quicksort(A, p, q - 1)
    quicksort(A, q + 1, r)


def fibonacci(n):
    if n == 0 or n == 1:
        return 1
    return fibonacci(n - 1) + fibonacci(n - 2)


def power(n, m):
    if m == 0:
        return 1
    else:
        return n * power(n, m - 1)

Raise m to the power of n.


def minimum(m):
    if len(m) == 1:
        return m[0]
    else:
        a = m.pop()
        b = m.pop()
        if a < b:
            m.append(a)
        else:
            m.append(b)
        return minimum(m)


def maximum(m):
    if len(m) == 1:
        return m[0]
    else:
        a = m.pop()
        b = m.pop()
        if a > b:
            m.append(a)
        else:
            m.append(b)
        return maximum(m)


def reverse_list(m):
    if len(m) == 1:
        return m
    else:
        return [m.pop()] + reverse_list(m)

Recursively reverse a list of elements.


def reverse_list(m):
    if len(m) == 0:
        return m
    else:
        return [m.pop()] + reverse_list(m)

Recursively reverse a list of elements.


def selectionsort(n):
    i = 0
    while i < len(n):
        position = i
        j = i + 1
        while j < len(n):
            if n[j] < n[position]:
                position = j
            j = j + 1
        val = n[position]
        n[position] = n[i]
        n[i] = val
        i = i + 1


def power(a, b):
    if b == 0:
        return 1
    return a * power(a, b - 1)

Raise m to the power of n.


Raise m to the power of n.


def minimum(value):
    if len(value) == 1:
        return value[0]
    if value[0] < value[1]:
        value.remove(value[1])
        return minimum(value)
    else:
        value.remove(value[0])
        return minimum(value)


def maximum(number):
    if len(number) == 1:
        return number[0]
    if number[0] > number[1]:
        number.remove(number[1])
        return maximum(number)
    else:
        number.remove(number[0])
        return maximum(number)


def count_letters(s):
    number = 0
    if not s:
        return 0
    else:
        number += 1
        return number + count_letters(s[1:])


def quicksort(a, p, r):
    if r <= p:
        return
    q = partition(a, p, r)
    quicksort(a, p, q - 1)
    quicksort(a, q + 1, r)

def minimum(a):
    quicksort(a, 0, len(a) - 1)
    return a[0]


def reverse_list(value):
    if len(value) == 0:
        return []
    return [value[-1]] + reverse_list(value[:-1])

Recursively reverse a list of elements.


Recursively reverse a list of elements.


def quicksort(a, p, r):
    if r <= p:
        return
    q = partition(a, p, r)
    quicksort(a, p, q - 1)
    quicksort(a, q + 1, r)

def maximum(a):
    quicksort(a, 0, len(a) - 1)
    return a[-1]


def count_letters(s):
    if s == '':
        return 0
    return count_letters(s[:-1]) + 1


def fibonacci(value):
    if value == 1 or value == 0:
        return 1
    return fibonacci(value - 1) + fibonacci(value - 2)


def sort(A, p, r):
    q = j = p
    while j < r:
        if A[j] <= A[r]:
            A[q], A[j] = A[j], A[q]
            q += 1
        j += 1
    A[q], A[r] = A[r], A[q]
    return q

def quicksort(A, p, r):
    if r <= p:
        return
    q = sort(A, p, r)
    quicksort(A, p, q - 1)
    quicksort(A, q + 1, r)


def fibonacci(n):
    if n == 0:
        return 0
    elif n == 1:
        return 1
    else:
        return fibonacci(n - 2) + fibonacci(n - 1)


def fibonacci(n):
    if n == 1:
        return 1
    else:
        return fibonacci(n - 2) + fibonacci(n - 1)


def fibonacci(a):
    prev = 1
    curr = 1
    tmp = 0
    i = 0
    for i in range(0, a):
        tmp = curr
        curr = prev + curr
        prev = tmp


def fibonacci(a):
    prev = 1
    curr = 1
    tmp = 0
    i = 0
    for i in range(0, a):
        tmp = curr
        curr = prev + curr
        prev = tmp
    return curr


def fibonacci(a):
    prev = 1
    curr = 1
    tmp = 0
    i = 0
    for i in range(0, a):
        tmp = curr
        curr = prev + curr
        prev = tmp
    return prev


def fibonacci(a):
    prev = 1
    curr = 1
    for i in range(0, a):
        tmp = curr
        curr = prev + curr
        prev = tmp
    return prev


def partition(A, p, r):
    q = j = p
    while j < r:
        if A[j] <= A[r]:
            A[q], A[j] = A[j], A[q]
            q += 1
        j += 1
    A[q], A[r] = A[r], A[q]
    return q

def quicksort(A, p, r):
    if r <= p:
        return
    q = partition(A, p, r)
    quicksort(A, p, q - 1)
    quicksort(A, q + 1, r)


def selectionsort(a):
    for i in range(0, len(a)):
        p = i
        j = i + 1
        while j < len(a):
            if a[j] < a[p]:
                p = j
            j = j + 1
        tmp = a[p]
        a[p] = a[i]
        a[i] = tmp


def count_letters(m):
    if m == '':
        return 0
    else:
        return 1 + count_letters(m[1:])


def reverse_list(m):
    if len(m) == 0:
        return []
    else:
        return [m[-1]] + reverse_list(m[:-1])

Recursively reverse a list of elements.


def fibonacci(n):
    if n == 0 or n == 1:
        return 1
    else:
        return fibonacci(n - 1) + fibonacci(n - 2)


Raise m to the power of n.


def minimum(n):
    if n == 0:
        return 0
    i = 1
    p = 0
    while i < len(n):
        if n[i] < n[p]:
            n[p] = n[i]
        i = i + 1
    return n[p]


def minimum(n):
    if len(n) == 1:
        return l[0]
    else:
        minr = minimum(n[1:])
        return n[0] if n[0] < minr else minr


def minimum(n):
    if len(n) == 1:
        return n[0]
    else:
        minr = minimum(n[1:])
        return n[0] if n[0] < minr else minr


def maximum(n):
    if len(n) == 1:
        return n[0]
    maxr = maxi(n[1:])
    return n[0] if n[0] > maxr else minr


def maximum(n):
    if len(n) == 1:
        return n[0]
    maxr = maximum(n[1:])
    return n[0] if n[0] > maxr else minr


def power(num, pwr):
    return num ** pwr

Raise m to the power of n.


def maximum(n):
    if len(n) == 1:
        return n[0]
    maxr = maximum(n[1:])
    return n[0] if n[0] > maxr else maxr


def minimum(l):
    l = sorted(l)
    return l[0]


def power(x, n):
    if n == 0:
        return 1
    elif n == 1:
        return x
    else:
        return x * power(x, n - 1)

Raise m to the power of n.


def maximum(l):
    l = sorted(l)
    return l[-1]


def count_letters(string_):
    len(string_)


def power(x, y):
    if y == 0:
        return x
    return power(x ** y, y - 1)

Raise m to the power of n.


def count_letters(n):
    if len(n) == 1:
        return n[0]
    length = len(n)
    return length


def count_letters(string_):
    counter = 0
    for i in string:
        counter += 1
    return counter


def count_letters(string_):
    counter = 0
    for i in string_:
        counter += 1
    return counter


def count_letters(n):
    if len(n) == 1:
        return n[0]
    return 1 + count_letters(n[0:])


def power(x, y):
    if y == 0:
        return 1
    return x * power(x, y - 1)

Raise m to the power of n.


Raise m to the power of n.


def count_letters(n):
    if len(n) == 1:
        return n[0]
    return 1 + count_letters(n[1:])


def minimum(a):
    if len(a) == 1:
        return a[0]
    else:
        return min(a[0], minimum(a[1:]))


def maximum(list):
    if len(list) == 1:
        return list[0]
    else:
        m = maximum(list[1:])
        return m if m > list[0] else list[0]


def count_letters(s):
    if not s:
        return 0
    else:
        return 1 + count_letters(s[1:])


def reverse_list(l):
    reversedlist = []
    i = len(l) - 1
    while i > -1:
        reversedlist.append(l[i])
        i = i - 1
    return reversedlist

Recursively reverse a list of elements.


Recursively reverse a list of elements.


def reverse_list(l):
    if l == []:
        return []
    tmp = reverse_list(l[1:])
    tmp.append(l[0])
    return tmp

Recursively reverse a list of elements.


def fibonacci(n):
    if n <= 1:
        return 1
    return fibonacci(n - 1) + fibonacci(n - 2)


def partition(A, p, r):
    q = j = p
    while j < r:
        if A[j] <= A[r]:
            A[q], A[j] = A[j], A[q]
            q += 1
        j += 1
    A[q], A[r] = A[r], A[q]
    return q

def quicksort(A, p, r):
    if r <= p:
        return
    q = partition(A, p, r)
    quicksort(A, p, q - 1)
    quicksort(A, q + 1, r)


def minimum(a):
    lowest = sum(a)
    for e in a:
        if e < lowest:
            lowest = e
    return lowest


def maximum(a):
    highest = 0
    for e in a:
        if e > highest:
            highest = e
    return highest


def count_letters(s):
    l = 0
    for e in s:
        l += 1
    return l


def fibonacci(n):
    if n <= 1:
        return 1
    else:
        return fibonacci(n - 1) + fibonacci(n - 2)


def count_letters(s):
    if s == '':
        return 0
    else:
        return 1 + count_letters(s[1:])


def maximum(s):
    if len(s) == 1:
        return s[0]
    else:
        maxi = maximum(s[1:])
        return s[0] if s[0] > maxi else maxi


def power(m, n):
    if n == 0:
        return 1
    else:
        return m ** n

Raise m to the power of n.


Raise m to the power of n.


def reverse_list(s):
    if len(s) == 0:
        return []
    else:
        return [s[-1]] + reverse_list(s[:-1])

Recursively reverse a list of elements.


def power(x, n):
    if x == 0:
        return 1
    return x * power(n - 1)

Raise m to the power of n.


def power(x, n):
    if x == 0:
        return 1
    return x * power(x, n - 1)

Raise m to the power of n.


def power(x, n):
    if n == 0:
        return 1
    return x * power(x, n - 1)

Raise m to the power of n.


def quicksort(A, start, end):
    if end - start < 1:
        return
    i = j = start
    while i <= end:
        if A[i] <= A[end]:
            A[i], A[j] = A[j], A[i]
            j += 1
        i += 1
    quicksort(A, start, j - 2)
    quicksort(A, j, end)


def power(a, b):
    if b == 1:
        return a
    if b == 0:
        return 1
    return a * power(a, b - 1)

Raise m to the power of n.


def power(m, n):
    if n == 0:
        return 1
    return m * power(m, n - 1)

Raise m to the power of n.


def selectionsort(m):
    for i in range(len(m)):
        n = i
        for j in range(i, len(m)):
            if m[j] < m[n]:
                n = j
                m[i], m[n] = m[n], m[i]


def selectionsort(m):
    for i in range(len(m)):
        min_j = i
        for j in range(i, len(m)):
            if m[j] < m[min_j]:
                min_j = j
                m[i], m[min_j] = m[min_j], m[i]


def minimum(l):
    if len(l) == 1:
        return l[0]
    if l[0] < l[1]:
        l.remove(l[1])
    else:
        l.remove(l[0])
    return minimum()


def minimum(l):
    if len(l) == 1:
        return l[0]
    if l[0] < l[1]:
        l.remove(l[1])
    else:
        l.remove(l[0])
    return minimum(l)


def selectionsort(m):
    for i in range(len(m)):
        n = i
        for j in range(i, len(m)):
            if m[j] < m[n]:
                n = j
        m[i], m[n] = m[n], m[i]


def maximum(l):
    if len(l) == 1:
        return l[0]
    if l[0] > l[1]:
        l.remove(l[1])
    else:
        l.remove(l[0])
    return maximum(l)


def count_letters(l):
    letter_sum = 0
    for k in l:
        letter_sum += 1
    return count_letters(l)


def quicksort(l, beg, fin):
    if fin - beg < 1:
        return
    i = j = beg
    while i <= fin:
        if l[i] <= l[fin]:
            l[i], l[j] = l[j], l[i]
            j += 1
        i += 1
    quicksort(l, beg, j - 2)
    quicksort(l, j, fin)


def selectionsort(A):
    for i in range(len(A)):
        min_j = i
        for j in range(i, len(A)):
            if A[j] < A[min_j]:
                min_j = j
        A[i], A[min_j] = A[min_j], A[i]


def minimum(s):
    if len(s) == 1:
        return s[0]
    else:
        min_ret = minimum(s[1:])
        return s[0] if s[0] < min_ret else min_ret


def count_letters(l):
    return 1 + count_letters(s[1:]) if l else 0


def count_letters(l):
    return 1 + count_letters(l[1:]) if l else 0


def fibonacci(n):
    a, b = 1, 1
    for i in range(n - 1):
        a, b = b, a + b
    return a


Test if two circles overlap.


def append2list(l1, l2=None):
    if l2 == None:
        l2 = []
    for i in l1:
        l2.append(i)
    return l2

Appends elements of a list l1 at the end of the list l2. If l2 not supplied default to empty list.


def fibonacci(n):
    a, b = 1, 1
    for i in range(n):
        a, b = b, a + b
    return a


def reverse_list(l):
    for i in reversed(l):
        return reverse_list(l)

Recursively reverse a list of elements.


def minimum(l):
    if len(l) == 1:
        return l[0]
    if l[0] < l[-1]:
        return minimum(l[:-1])
    else:
        return minimum(l[1:])


def reverse_list(l):
    return l.reverse()

Recursively reverse a list of elements.


def reverse_list(l):
    return [x for x in reversed(l)]

Recursively reverse a list of elements.


Recursively reverse a list of elements.


def fibonacci(a):
    if a == 0:
        return 1
    elif n == 1:
        return 1
    return fibonacci(n - 1) + fibonacci(n - 2)


def fibonacci(a):
    if a == 0:
        return 1
    elif a == 1:
        return 1
    return fibonacci(a - 1) + fibonacci(a - 2)


def maximum(l):
    if len(l) == 1:
        return l[0]
    if l[0] < l[-1]:
        return maximum(l[1:])
    else:
        return maximum(l[:-1])


def selectionsort(a):
    i = 0
    while i < len(a):
        p = i
        j = i + 1
        while j < len(a):
            if a[j] < a[p]:
                p = j
            j = j + 1
        tmp = a[p]
        a[p] = a[i]
        a[i] = tmp
        i = i + 1
    return a


def power(n, m):
    if m == 1:
        return n
    if m == 0:
        return 1
    return n * power(n, m - 1)

Raise m to the power of n.


Raise m to the power of n.


def minimum(l):
    if len(l) == 1:
        return l[0]
    if l[0] < l[1]:
        l.remove(l[1])
    else:
        l.remove(l[0])
    return minimum(l)


def minimum(l):
    if len(l) == 1:
        return l[0]
    else:
        m = minimum(l[1:])
        if m < l[0]:
            return m
        else:
            return l[0]


def maximum(l):
    if len(l) == 1:
        return l[0]
    if l[0] > l[1]:
        l.remove(l[1])
    else:
        l.remove(l[0])
    return maximum(l)


def maximum(l):
    if len(l) == 1:
        return l[0]
    else:
        m = maximum(l[1:])
        if m > l[0]:
            return m
        else:
            return l[0]


def count_letters(s):
    if s == '':
        return 0
    return 1 + count_letters(s[:-1])


def count_letters(s):
    n = 0
    if not s:
        return 0
    else:
        n += 1
        return n + count_letters(s[1:])


def reverse_list(a):
    if len(a) == 0:
        return []
    return [a[-1]] + reverse_list(a[:-1])

Recursively reverse a list of elements.


def fibonacci(n):
    if n == 1 or n == 0:
        return 1
    return fibonacci(n - 1) + fibonacci(n - 2)


def partition(A, p, r):
    q = j = p
    while j < r:
        if A[j] <= A[r]:
            A[q], A[j] = A[j], A[q]
            q += 1
        j += 1
    A[q], A[r] = A[r], A[q]
    return q

def quicksort(A, p, r):
    if r <= p:
        return
    q = partition(A, p, r)
    quicksort(A, p, q - 1)
    quicksort(A, q + 1, r)


def selectionsort(a):
    i = 0
    while i < len(a):
        p = i
        j = i + 1
        while j < len(a):
            if a[j] < a[p]:
                p = j
            j += 1
        tmp = a[p]
        a[p] = a[i]
        a[i] = tmp
        i += 1


def count_letters(s):
    if s == '':
        return 0
    else:
        return 1 + count_letters(s[1:])


def reverse_list(l):
    if len(l) == 0:
        return []
    else:
        return [l[-1]] + reverse_list(l[:-1])

Recursively reverse a list of elements.


Recursively reverse a list of elements.


def fibonacci(n):
    if n <= 1:
        return 1
    else:
        return fibonacci(n - 1) + fibonacci(n - 2)


def fibonacci(n):
    if n == 0:
        return 1
    elif n == 1:
        return 1
    return fibonacci(n - 1) + fibonacci(n - 2)


def fibonacci(s):
    if s == 0:
        return 0
    if s in (1, 2):
        return 1
    return fibonacci(s - 1) + fibonacci(s - 2)


def fibonacci(s):
    if s == 0:
        return 0
    if s in (0, 1):
        return 1
    return fibonacci(s - 1) + fibonacci(s - 2)


def fibonacci(s):
    if s in (0, 1):
        return 1
    return fibonacci(s - 1) + fibonacci(s - 2)


def power(n, p):
    if p == 0:
        return 1
    return n ** p

Raise m to the power of n.


Raise m to the power of n.


def quicksort(array, b, c):
    less = []
    greater = []
    equal = []
    if len(array) > 0:
        piv = array[0]
        less = [i for i in array if i < piv]
        greater = [i for i in array if i > piv]
        greater = [i for i in array if i == piv]
        array = less + greater + equal


def quicksort(array, b, c):
    less = []
    greater = []
    equal = []
    if len(array) > 0:
        piv = array[0]
        less = [i for i in array if i < piv]
        greater = [i for i in array if i > piv]
        greater = [i for i in array if i == piv]
        array = greater + equal + less


def quicksort(array, b, c):
    less = []
    greater = []
    equal = []
    if len(array) > 0:
        piv = array[0]
        less = [i for i in array if i < piv]
        greater = [i for i in array if i > piv]
        less = [i for i in array if i == piv]
        quicksort(greater, b, c)
        quicksort(less, b, c)
        array = greater + equal + less


def quicksort(array, b, c):
    less = []
    greater = []
    equal = []
    if len(array) > 0:
        piv = array[0]
        less = [i for i in array if i < piv]
        greater = [i for i in array if i > piv]
        equal = [i for i in array if i == piv]
        quicksort(greater, b, c)
        quicksort(less, b, c)
        array = greater + equal + less


def quicksort(array, b, c):
    less = []
    greater = []
    equal = []
    if len(array) > 0:
        piv = array[0]
        less = [i for i in array if i < piv]
        print(less)
        greater = [i for i in array if i > piv]
        equal = [i for i in array if i == piv]
        quicksort(greater, b, c)
        quicksort(less, b, c)
        array = greater + equal + less


def _quicksort(array):
    less = []
    greater = []
    equal = []
    if len(array) > 0:
        piv = array[0]
        less = [i for i in array if i < piv]
        greater = [i for i in array if i > piv]
        equal = [i for i in array if i == piv]
        return quicksort(greater, b, c) + equal + quicksort(less, b, c)

def quicksort(array, a, b):
    array = _quicksort(array)


def _quicksort(array):
    less = []
    greater = []
    equal = []
    if len(array) > 0:
        piv = array[0]
        less = [i for i in array if i < piv]
        greater = [i for i in array if i > piv]
        equal = [i for i in array if i == piv]
        return quicksort(greater) + equal + quicksort(less)

def quicksort(array, a, b):
    array = _quicksort(array)


def _quicksort(array):
    less = []
    greater = []
    equal = []
    if len(array) > 0:
        piv = array[0]
        less = [i for i in array if i < piv]
        greater = [i for i in array if i > piv]
        equal = [i for i in array if i == piv]
        return _quicksort(greater) + equal + _quicksort(less)

def quicksort(array, a, b):
    array = _quicksort(array)


def _quicksort(array):
    less = []
    greater = []
    equal = []
    if len(array) > 0:
        piv = array[0]
        less = [i for i in array if i < piv]
        greater = [i for i in array if i > piv]
        equal = [i for i in array if i == piv]
        return _quicksort(greater) + equal + _quicksort(less)
    else:
        return []

def quicksort(array, a, b):
    array = _quicksort(array)


def _quicksort(array):
    less = []
    greater = []
    print(greater)
    equal = []
    if len(array) > 0:
        piv = array[0]
        less = [i for i in array if i < piv]
        greater = [i for i in array if i > piv]
        equal = [i for i in array if i == piv]
        return _quicksort(greater) + equal + _quicksort(less)
    else:
        return []

def quicksort(array, a, b):
    array = _quicksort(array)


def minimum(l):
    l = sorted(minimum(l))
    return l[0]


def _quicksort(array):
    less = []
    greater = []
    print(greater)
    equal = []
    if len(array) > 0:
        piv = array[0]
        print(piv)
        less = [i for i in array if i < piv]
        greater = [i for i in array if i > piv]
        equal = [i for i in array if i == piv]
        return _quicksort(greater) + equal + _quicksort(less)
    else:
        return []

def quicksort(array, a, b):
    array = _quicksort(array)


def _quicksort(array):
    if len(array) > 0:
        piv = array[0]
        less = [i for i in array if i < piv]
        greater = [i for i in array if i > piv]
        equal = [i for i in array if i == piv]
        return _quicksort(greater) + equal + _quicksort(less)
    else:
        return []

def quicksort(array, a, b):
    array = _quicksort(array)


def minimum(l):
    if len(l) == 1:
        return l[0]
    elif l[0] > l[1]:
        l.remove(l[0])
    else:
        l.remove(l[1])
    return minimum(l)


def _quicksort(array):
    if len(array) > 0:
        piv = array[0]
        less = [i for i in array if i < piv]
        print(less)
        greater = [i for i in array if i >= piv]
        return _quicksort(greater) + _quicksort(less)
    else:
        return []

def quicksort(array, a, b):
    array = _quicksort(array)


def maximum(l):
    if len(l) == 1:
        return l[0]
    elif l[0] < l[1]:
        l.remove(l[0])
    else:
        l.remove(l[1])
    return minimum(l)


def _quicksort(array):
    if len(array) > 0:
        piv = array[0]
        less = []
        greater = []
        for i in array:
            if i < piv:
                less += i
            else:
                greater += i
        return _quicksort(greater) + _quicksort(less)
    else:
        return []

def quicksort(array, a, b):
    array = _quicksort(array)


def _quicksort(array):
    if len(array) > 0:
        piv = array[0]
        less = []
        greater = []
        for i in array:
            if i < piv:
                less = less + i
            else:
                greater = greater + i
        return _quicksort(greater) + _quicksort(less)
    else:
        return []

def quicksort(array, a, b):
    array = _quicksort(array)


def _quicksort(array):
    if len(array) > 0:
        piv = array[0]
        less = []
        greater = []
        for i in array:
            if i < piv:
                less = less + [i]
            else:
                greater = greater + [i]
        return _quicksort(greater) + _quicksort(less)
    else:
        return []

def quicksort(array, a, b):
    array = _quicksort(array)


def maximum(l):
    if len(l) == 1:
        return l[0]
    elif l[0] < l[1]:
        l.remove(l[0])
    else:
        l.remove(l[1])
    return maximum(l)


def _quicksort(array):
    if len(array) > 0:
        piv = array[0]
        less = []
        greater = []
        for i in array:
            if i < piv:
                less = less + [i]
            else:
                greater = greater + [i]
        print(less)
        return _quicksort(greater) + _quicksort(less)
    else:
        return []

def quicksort(array, a, b):
    array = _quicksort(array)


def _quicksort(array):
    if array <= 1:
        return array
    else:
        piv = array[0]
        less = []
        greater = []
        for i in array:
            if i < piv:
                less = less + [i]
            else:
                greater = greater + [i]
        return _quicksort(greater) + _quicksort(less)

def quicksort(array, a, b):
    array = _quicksort(array)


def _quicksort(array):
    if len(array) <= 1:
        return array
    else:
        piv = array[0]
        less = []
        greater = []
        for i in array:
            if i < piv:
                less = less + [i]
            else:
                greater = greater + [i]
        return _quicksort(greater) + _quicksort(less)

def quicksort(array, a, b):
    array = _quicksort(array)


def _quicksort(array):
    if len(array) <= 1:
        return array
    else:
        piv = array[0]
        less = []
        greater = []
        for i in array:
            if i < piv:
                less = less + [i]
            else:
                greater = greater + [i]
        less = _quicksort(less)
        more = _quicksort(more)
        return less + more

def quicksort(array, a, b):
    array = _quicksort(array)


def _quicksort(array):
    if len(array) <= 1:
        return array
    else:
        piv = array[0]
        less = []
        greater = []
        for i in array:
            if i < piv:
                less = less + [i]
            else:
                greater = greater + [i]
        less = _quicksort(less)
        greater = _quicksort(greater)
        return less + greater

def quicksort(array, a, b):
    array = _quicksort(array)


def _quicksort(array):
    if not array:
        return []
    else:
        pivot = array[0]
        less = [x for x in array if x < pivot]
        more = [x for x in array[1:] if x >= pivot]
        return quicksort(less) + [pivot] + quicksort(more)

def quicksort(l, a, b):

    def _quicksort(array):
        if not array:
            return []
        else:
            pivot = array[0]
            less = [x for x in array if x < pivot]
            more = [x for x in array[1:] if x >= pivot]
            return quicksort(less) + [pivot] + quicksort(more)
    l = _quicksort(l)


Raise m to the power of n.


def _quicksort(array):
    if not array:
        return []
    else:
        pivot = array[0]
        less = [x for x in array if x < pivot]
        more = [x for x in array[1:] if x >= pivot]
        return _quicksort(less) + [pivot] + _quicksort(more)

def quicksort(l, a, b):

    def _quicksort(array):
        if not array:
            return []
        else:
            pivot = array[0]
            less = [x for x in array if x < pivot]
            more = [x for x in array[1:] if x >= pivot]
            return _quicksort(less) + [pivot] + _quicksort(more)
    l = _quicksort(l)


def _quicksort(array):
    if not array:
        return []
    else:
        pivot = array[0]
        less = [x for x in array if x < pivot]
        more = [x for x in array[1:] if x >= pivot]
        return _quicksort(less) + [pivot] + _quicksort(more)

def quicksort(l, a, b):

    def _quicksort(array):
        if not array:
            return []
        else:
            pivot = array[0]
            less = [x for x in array if x < pivot]
            more = [x for x in array[1:] if x >= pivot]
            return _quicksort(less) + [pivot] + _quicksort(more)
    print(_quicksort(l))


Recursively reverse a list of elements.


def _quicksort(array):
    if not array:
        return []
    else:
        pivot = array[0]
        less = [x for x in array if x < pivot]
        more = [x for x in array[1:] if x >= pivot]
        return _quicksort(less) + [pivot] + _quicksort(more)

def quicksort(l, a, b):

    def _quicksort(array):
        if not array:
            return []
        else:
            pivot = array[0]
            less = [x for x in array if x < pivot]
            more = [x for x in array[1:] if x >= pivot]
            return _quicksort(less) + [pivot] + _quicksort(more)
    l[:] = _quicksort(l)


def fibonacci(n):
    if n == 0 or n == 1:
        return 1
    return fibonacci(n - 1) + fibonacci(n - 2)


def chksorted(a):
    for i in range(len(a) - 1):
        if not a[i] < a[i + 1]:
            return False
    return True

def selectionsort(array):

    def chksorted(a):
        for i in range(len(a) - 1):
            if not a[i] < a[i + 1]:
                return False
        return True
    m = min(array)
    mi = array.index(m)
    if not chksorted(array):
        f = array[0]
        array[0] = m
        array[mi] = f


def partition(A, p, r):
    q = j = p
    while j < r:
        if A[j] <= A[r]:
            A[q], A[j] = A[j], A[q]
            q += 1
        j += 1
    A[q], A[r] = A[r], A[q]
    return q

def quicksort(A, p, r):

    def partition(A, p, r):
        q = j = p
        while j < r:
            if A[j] <= A[r]:
                A[q], A[j] = A[j], A[q]
                q += 1
            j += 1
        A[q], A[r] = A[r], A[q]
        return q
    if r <= p:
        return
    q = partition(A, p, r)
    quicksort(A, p, q - 1)
    quicksort(A, q + 1, r)


def selectionsort(array):
    for i in range(len(arr)):
        for j in range(i, len(arr)):
            if arr[i] > arr[j]:
                arr[i], arr[j] = arr[j], arr[i]


def selectionsort(array):
    for i in range(len(array)):
        for j in range(i, len(array)):
            if array[i] > array[j]:
                array[i], array[j] = array[j], array[i]


def selectionsort(n):
    i = 0
    while i < len(n):
        p = i
        j = i + 1
        while j < len(n):
            if n[j] < n[i]:
                p = j
            j += 1
        tmp = n[p]
        n[p] = n[i]
        n[i] = temp
        i = +1


def selectionsort(n):
    i = 0
    while i < len(n):
        p = i
        j = i + 1
        while j < len(n):
            if n[j] < n[i]:
                p = j
            j += 1
        tmp = n[p]
        n[p] = n[i]
        n[i] = tmp
        i = +1


def selectionsort(A):
    i = 0
    while i < len(A):
        p = i
        j = i + 1
        while j < len(A):
            if A[j] < A[i]:
                p = j
            j += 1
        tmp = A[p]
        A[p] = A[i]
        A[i] = tmp
        i = +1


def selectionsort(a):
    i = 0
    while i < len(a):
        p = i
        j = i + 1
        while j < len(a):
            if a[j] < a[i]:
                p = j
            j += 1
        tmp = a[p]
        a[p] = a[i]
        a[i] = tmp
        i = +1


def selectionsort(A):
    i = 0
    while i < len(A):
        p = i
        j = i + 1
        while j < len(A):
            if A[j] < A[i]:
                p = j
            j += 1
        tmp = A[p]
        A[p] = A[i]
        A[i] = tmp
        i = +1
    return selectionsort(A)


def selectionsort(A):
    i = 0
    while i < len(A):
        p = i
        j = i + 1
        while j < len(A):
            if A[j] < A[p]:
                p = j
            j += 1
        tmp = A[p]
        A[p] = A[i]
        A[i] = tmp
        i = +1


def selectionsort(A):
    i = 0
    while i < len(A):
        p = i
        j = i + 1
        while j < len(A):
            if A[j] < A[p]:
                p = j
            j += 1
        tmp = A[p]
        A[p] = A[i]
        A[i] = tmp
        i += 1


Raise m to the power of n.


def fibonacci(n):
    if n == 1 or n == 0:
        return 1
    else:
        return fibonacci(n - 1) + fibonacci(n - 2)


def selectionsort(a):
    i = 0
    while i < len(a):
        p = i
        j = i + 1
        while j < len(a):
            if a[j] < a[p]:
                p = j
            j = j + 1
        tmp = a[p]
        a[p] = a[i]
        a[i] = tmp
        i = i + 1


def partition(A, p, r):
    q = j = p
    while j < r:
        if A[j] <= A[r]:
            A[q], A[j] = A[j], A[q]
            q = q + 1
        j = j + 1
    A[q], A[r] = A[r], A[q]
    return q

def quicksort(A, p, r):
    if r <= p:
        return
    q = partition(A, p, r)
    quicksort(A, p, q - 1)
    quicksort(A, q + 1, r)


def reverse_list(n):
    if len(n) == 1:
        return n
    else:
        return [n[0]] + reverse_list(n[1:])

Recursively reverse a list of elements.


def reverse_list(n):
    if len(n) == 1:
        return n
    else:
        return [n[-1]] + reverse_list(n[:-1])

Recursively reverse a list of elements.


def reverse_list(n):
    if len(n) == 0:
        return []
    else:
        return [n[-1]] + reverse_list(n[:-1])

Recursively reverse a list of elements.


Recursively reverse a list of elements.


def count_letters(word):
    if len(word) == 0:
        return 0
    else:
        return 1 + count_letters(word[1:])


def fibonacci(n):
    if n == 0:
        return 1
    elif n == 1:
        return 1
    else:
        return fibonacci(n - 2) + fibonacci(n - 1)


def power(m, n):
    if n == 0:
        return 1
    return m ** n

Raise m to the power of n.


def minimum(n):
    n.sort()
    return n[0]


def maximum(n):
    n.sort()
    return n[-1]


def partition(A, p, r):
    q = j = p
    while j < r:
        if A[j] <= A[r]:
            A[q], A[j] = A[j], A[q]
            q += 1
        j += 1
    A[q], A[r] = A[r], A[q]
    return q

def quicksort(A, p, r):
    if r <= p:
        return
    q = partition(A, p, r)
    quicksort(A, p, q - 1)
    quicksort(A, q + 1, r)


def minimum(l):
    if len(l) == 1:
        return l[0]
    return min(l)


def minimum(l):
    if len(l) == 1:
        return l[0]
    return [s for s in l if all(s <= i for i in l)][0]


def maximum(l):
    if len(l) == 1:
        return l[0]
    return [s for s in l if all(s >= i for i in l)][0]


def recursive_selectionsort(A, i):
    if i >= len(a) - 1:
        return
    else:
        p = i
        j = i + 1
        while j < len(a):
            if a[j] < a[p]:
                p = j
            j = j + 1
        tmp = a[p]
        a[p] = a[i]
        a[i] = tmp
        recursive_selectionsort(A, i + 1)

def selectionsort(A):
    recursive_selectionsort(A, 0)


def recursive_selectionsort(A, i):
    if i >= len(A) - 1:
        return
    else:
        p = i
        j = i + 1
        while j < len(A):
            if A[j] < A[p]:
                p = j
            j = j + 1
        tmp = A[p]
        A[p] = A[i]
        A[i] = tmp
        recursive_selectionsort(A, i + 1)

def selectionsort(A):
    recursive_selectionsort(A, 0)


def count_letters(s):
    if s == '':
        return 0
    a = 0
    for letter in s:
        a += 1
    return a


def reverse_list(l):
    if l == []:
        return none
    return l[::-1]

Recursively reverse a list of elements.


def reverse_list(l):
    if l == []:
        return None
    return l[::-1]

Recursively reverse a list of elements.


def reverse_list(l):
    if l == []:
        return []
    return l[::-1]

Recursively reverse a list of elements.


def fibonacci(n):
    if n <= 1:
        return 1
    return fibonacci(n - 1) + fibonacci(n - 2)


def selectionsort(a):
    a = a[:]
    out = []
    while a:
        smallest = min(a)
        a.remove(smallest)
        out.append(smallest)
    return out


Raise m to the power of n.


def power(m, n):
    if n == 0:
        return 1
    return m * power(m, n - 1)

Raise m to the power of n.


def selectionsort(a):
    a = a[:]
    out = []
    if a:
        smallest = min(a)
        a.remove(smallest)
        out.append(smallest)
    return out


def minimum(l):
    if len(l) == 1:
        return l[0]
    tmp = minimum(l[1:])
    return tmp if tmp > l[0] else l[0]


def minimum(l):
    if len(l) == 1:
        return l[0]
    tmp = minimum(l[1:])
    return tmp if tmp < l[0] else l[0]


def minimum(l):
    if len(l) == 1:
        return l[0]
    m = minimum(l[1:])
    return m if m < l[0] else l[0]


def maximum(l):
    if len(l) == 1:
        return l[0]
    m = maximum(l[1:])
    return m if m > l[0] else l[0]


def selectionsort(a):
    a = a[:]
    sortedlist = []
    while a:
        smallest = min(a)
        a.remove(smallest)
        sortedlist.append(smallest)
    return sortedlist


def selectionsort(a):
    i = 0
    while i < len(a):
        p = i
        j = i + 1
    while j < len(a):
        if a[j] < a[p]:
            p = j
        j += 1
    timp = a[p]
    a[p] = a[i]
    a[i] = temp
    i += 1


def count_letters(s):
    if s == '':
        return 0
    return count_letters(s[1:]) + 1


def reverse_list(l):
    if l == []:
        return []
    return reverse_list(l[1]).append(l[0])

Recursively reverse a list of elements.


def reverse_list(l):
    if l == []:
        return []
    return reverse_list(l[1:]).append(l[0])

Recursively reverse a list of elements.


Recursively reverse a list of elements.


def reverse_list(l):
    if l == []:
        return []
    return l[1:].append(l[0])

Recursively reverse a list of elements.


def reverse_list(l):
    if l == []:
        return []
    return l.append(l[0])

Recursively reverse a list of elements.


def reverse_list(l):
    if l == []:
        return []
    return l

Recursively reverse a list of elements.


def reverse_list(l):
    if l == []:
        return []
    return l[0]

Recursively reverse a list of elements.


def reverse_list(l):
    if l == []:
        return []
    return [1, 2].append(l[0])

Recursively reverse a list of elements.


def swap(A, x, y):
    tmp = A[x]
    A[x] = A[y]
    A[y] = tmp

def selectionsort(a):
    for i in range(len(a)):
        least = i
        for k in range(i + 1, len(a)):
            if a[k] < a[least]:
                least = k
        swap(a, least, i)


def reverse_list(l):
    if l == []:
        return []
    new = reverse_list(l[1:]).append(l[0])
    return new

Recursively reverse a list of elements.


def reverse_list(l):
    if l == []:
        return []
    new = l.append(l[0])
    return new

Recursively reverse a list of elements.


def reverse_list(l):
    if l == []:
        return []
    new = l[1:]
    return new

Recursively reverse a list of elements.


def reverse_list(l):
    if l == []:
        return []
    return l[1:] + l[0]

Recursively reverse a list of elements.


def reverse_list(l):
    if l == []:
        return []
    return reverse_list(l[1:]) + [l[0]]

Recursively reverse a list of elements.


def reverse_list(l):
    return reverse_list(l[1:]) + [l[0]] if l else []

Recursively reverse a list of elements.


def fibonacci(n):
    if n < 2:
        return 1
    return fibonacci(n - 1) + fibonacci(n - 2)


def partition(a, p, r):
    q = j = p
    while j < r:
        if a[j] <= a[r]:
            a[q], a[j] = a[j], a[q]
            q += 1
        j += 1
    a[q], a[r] = a[r], a[q]
    return q

def quicksort(a, q, r):
    if r <= q:
        return
    q = partition(a, p, r)
    quicksort(a, p, q - 1)
    quicksort(a, q + 1, r)


def partition(a, p, r):
    q = j = p
    while j < r:
        if a[j] <= a[r]:
            a[q], a[j] = a[j], a[q]
            q += 1
        j += 1
    a[q], a[r] = a[r], a[q]
    return q

def quicksort(a, p, r):
    if r <= q:
        return
    q = partition(a, p, r)
    quicksort(a, p, q - 1)
    quicksort(a, q + 1, r)


def partition(a, p, r):
    q = j = p
    while j < r:
        if a[j] <= a[r]:
            a[q], a[j] = a[j], a[q]
            q += 1
        j += 1
    a[q], a[r] = a[r], a[q]
    return q

def quicksort(a, p, r):
    if r <= p:
        return
    q = partition(a, p, r)
    quicksort(a, p, q - 1)
    quicksort(a, q + 1, r)


def partition(a, p, pivot):
    q = j = p
    while j < pivot:
        if a[j] <= a[pivot]:
            a[q], a[j] = a[j], a[q]
            q += 1
        j += 1
    a[q], a[pivot] = a[pivot], a[q]
    return q

def quicksort(a, p, pivot):
    if pivot <= p:
        return
    q = partition(a, p, pivot)
    quicksort(a, p, q - 1)
    quicksort(a, q + 1, pivot)


def partition(a, start, pivot):
    lower = upper = start
    while upper < pivot:
        if a[upper] <= a[pivot]:
            a[lower], a[upper] = a[upper], a[lower]
            lower += 1
        upper += 1
    a[lower], a[pivot] = a[pivot], a[lower]
    return lower

def quicksort(a, start, pivot):
    if pivot <= start:
        return
    lower = partition(a, start, pivot)
    quicksort(a, start, lower - 1)
    quicksort(a, lower + 1, pivot)


def partition(a, start, pivot):
    lower = upper = start
    while upper < pivot:
        if a[upper] <= a[pivot]:
            a[lower], a[upper] = a[upper], a[lower]
            lower += 1
        upper += 1
    a[lower], a[pivot] = a[pivot], a[lower]
    return lower

def quicksort(a, start, pivot):
    if pivot <= start:
        return
    mid = partition(a, start, pivot)
    quicksort(a, start, mid - 1)
    quicksort(a, mid + 1, pivot)


def selectionsort(a):
    i = 0
    while i < len(a):
        p = i
        j = i + 1
        while j < len(a):
            if a[j] < a[p]:
                p = j
            j = j + 1
        tmp = a[p]
        a[p] = a[i]
        a[i] = tmp
        i = i + 1
    k = 0
    while k < len(a):
        print(a[k])
        k = k + 1


def selectionsort(a):
    i = 0
    while i < len(a):
        p = i
        j = i + 1
        while j < len(a):
            if a[j] < a[p]:
                p = j
            j = j + 1
        tmp = a[p]
        a[p] = a[i]
        a[i] = tmp
        i = i + 1


def selectionsort(a):
    i = 0
    while i < len(a):
        p = i
        j = i + 1
        while j < len(a):
            if a[j] < a[p]:
                p = j
            j = j + 1
        a[p], a[i] = a[i], a[p]
        i = i + 1


def selectionsort(a):
    i = 0
    while i < len(a):
        p = i
        j = i + 1
        while j < len(a):
            if a[j] < a[p]:
                p = j
            j += 1
        tmp = a[p]
        a[p] = a[i]
        a[i] = tmp
        i += 1


def sort(A, p, r):
    q = j = p
    while j < r:
        if A[j] <= A[r]:
            A[q], A[j] = A[j], A[q]
            q += 1
        j += 1
    A[q], A[r] = A[r], A[q]
    return q

def quicksort(A, p, r):
    if r <= p:
        return
    q = sort(A, p, r)
    quicksort(A, p, q - 1)
    quicksort(A, q + 1, r)


def fibonacci(n):
    prev = 0
    cur = 1
    i = 0
    while i < n:
        tmp = cur
        cur = cur + prev
        prev = tmp
        i = i + 1
    return cur


def power(a, b):
    if b == 0:
        return 1
    return a * power(b - 1)

Raise m to the power of n.


def power(a, b):
    if b == 0:
        return 1
    return a * power(a, b - 1)

Raise m to the power of n.


Raise m to the power of n.


def minimum(a):
    if a == []:
        return 1
    tmp = a.pop()
    if tmp < minimun(a):
        return tmp


def minimum(a):
    if a.pop() < a[-1]:
        tmp = a.pop()
    if a == []:
        return tmp
    return minimum(a)


def minimum(a):
    if a == []:
        return tmp
    if a.pop() < a[-1]:
        tmp = a.pop()
    return minimum(a)


def minimum(a):
    if a == []:
        return tmp
    if a.pop() < a[-1]:
        print(a[-1])
        tmp = a.pop()
    return minimum(a)


def minimum(a):
    if a == []:
        return tmp
    if a.pop() < a[-1]:
        print(a.pop())
        tmp = a.pop()
    return minimum(a)


def minimum(a):
    if a == []:
        return b[0]
    if a[-1] < a[-2]:
        b.append(a[-1])
        if len(b) > 1:
            if b[0] > b[1]:
                b.remove(b[0])
            else:
                b.remove(b[1])
    return minimum(a[:-1])


def minimum(a, flag=True):
    if a == []:
        return tmp
    if flag == True:
        tmp = a.pop()
        print(tmp)
    if a[-1] < tmp:
        tmp = a[-1]
    return minimum(a[:-1], flag=False)


def selectionsort(A):
    i = 0
    while i < len(A):
        p = i
        j = i + 1
        while j < len(A):
            if A[j] < A[p]:
                p = j
            j = j + 1
        tmp = A[p]
        A[p] = A[i]
        A[i] = tmp
        i = i + 1
    return A


def partition(A, p, r):
    q = j = p
    while j < r:
        if A[j] <= A[r]:
            A[q], A[j] = A[j], A[q]
            q += 1
        j += 1
    A[q], A[r] = A[r], A[q]
    return q

def quicksort(A, p, r):
    if r <= p:
        return
    q = partition(A, p, r)
    quicksort(A, p, q - 1)
    quicksort(A, q + 1, r)


def minimum(a, flag=True):
    if a == []:
        return tmp
    if flag == True:
        tmp = a.pop()
    if a[-1] < tmp:
        tmp = a[-1]
    return minimum(a[:-1], flag=False)


def minimum(a, tmp=0):
    if a == []:
        return tmp
    if a[-1] < tmp:
        tmp = a[-1]
    return minimum(a[:-1], tmp)


def minimum(a, tmp=0):
    if a == []:
        return tmp
    if tmp == 0 or a[-1] < tmp:
        tmp = a[-1]
    return minimum(a[:-1], tmp)


def maximum(a, tmp=0):
    if a == []:
        return tmp
    if tmp == 0 or a[-1] > tmp:
        tmp = a[-1]
    return minimum(a[:-1], tmp)


def maximum(a, tmp=0):
    if a == []:
        return tmp
    if tmp == 0 or a[-1] > tmp:
        tmp = a[-1]
    return maximum(a[:-1], tmp)


def count_letters(a, count=0):
    if len(a) == 0:
        return count
    count += 1
    return count_letters(a - 1, count)


def count_letters(a, count=0):
    if len(a) == 0:
        return count
    count += 1
    return count_letters(a[:-1], count)


def reverse_list(a, b=[]):
    if a == []:
        return b
    b.append(a[-1])
    return reverse_list(a[:-1], b)

Recursively reverse a list of elements.


Recursively reverse a list of elements.


def reverse_list(a, b=[]):
    if a == []:
        tmp = b
        b = []
        return tmp
    b.append(a[-1])
    return reverse_list(a[:-1], b)

Recursively reverse a list of elements.


def reverse_list(a, b=''):
    if a == []:
        return b.split('')
    b += ' ' + a[-1]
    return reverse_list(a[:-1], b)

Recursively reverse a list of elements.


def reverse_list(a, b=''):
    if a == []:
        return b.split('')
    b += ' ' + str(a[-1])
    return reverse_list(a[:-1], b)

Recursively reverse a list of elements.


def reverse_list(a, b=''):
    if a == []:
        return b.split(' ')
    b += ' ' + str(a[-1])
    return reverse_list(a[:-1], b)

Recursively reverse a list of elements.


def reverse_list(a, b=''):
    if a == []:
        return b.strip.split(' ')
    b += ' ' + str(a[-1])
    return reverse_list(a[:-1], b)

Recursively reverse a list of elements.


def reverse_list(a, b=''):
    if a == []:
        return b.split(' ').strip()
    b += ' ' + str(a[-1])
    return reverse_list(a[:-1], b)

Recursively reverse a list of elements.


def reverse_list(a, b=''):
    if a == []:
        return b.strip().split(' ')
    b += ' ' + str(a[-1])
    return reverse_list(a[:-1], b)

Recursively reverse a list of elements.


def reverse_list(a, b=''):
    if a == []:
        return b
    b.append(a[-1])
    return reverse_list(a[:-1], b)

Recursively reverse a list of elements.


def reverse_list(a, b=[], flag=True):
    if flag == True:
        b = []
    if a == []:
        return b
    b.append(a[-1])
    return reverse_list(a[:-1], b, flag=False)

Recursively reverse a list of elements.


def fibonacci(a):
    if a == 0:
        return 0
    return 1 + fibonacci(a - 1)


def fibonacci(a):
    if a == 0:
        return 1
    return 1 + fibonacci(a - 1)


def fibonacci(a, curr=1):
    if a == 0:
        return curr
    return curr + fibonacci(a - 1, curr)


def power(m, n):
    if n == 0:
        return 1
    else:
        return power(m, n - 1) * m

Raise m to the power of n.


Raise m to the power of n.


def fibonacci(a, prev=1, curr=1):
    if a == 0:
        return 0
    return prev + fibonacci(a - 1, prev, curr)


def minimum(mylist):
    if len(mylist) == 1:
        return mylist[0]
    if mylist[0] > mylist[1]:
        mylist.remove(mylist[0])
        return minimum(mylist)
    else:
        mylist.remove(mylist[1])
        return minimum(mylist)


def minimum(l):
    if len(l) == 1:
        return l[0]
    m = minimum(l[1:])
    return m if m < l[0] else l[0]


def fibonacci(a, prev=0, curr=1):
    if a == 0:
        return 1
    return prev + fibonacci(a - 1, prev, curr)


def fibonacci(a, prev=0, curr=1):
    if a == 0:
        return 0
    prev = curr
    return 1 + fibonacci(a - 1, prev, curr)


def maximum(mylist):
    if len(mylist) == 1:
        return mylist[0]
    if mylist[0] < mylist[1]:
        mylist.remove(mylist[0])
        return minimum(mylist)
    else:
        mylist.remove(mylist[1])
        return minimum(mylist)


def maximum(l):
    if len(l) == 1:
        return l[0]
    m = minimum(l[1:])
    return m if m > l[0] else l[0]


def fibonacci(a, prev=0, curr=1):
    if a == 0:
        return 1
    prev = curr
    return 1 + fibonacci(a - 1, prev, curr)


def fibonacci(a, prev=0, curr=1):
    if a == 0:
        return prev
    prev = curr
    return 1 + fibonacci(a - 1, prev, curr)


def fibonacci(a, prev=0, curr=1):
    if a == 0:
        return prev
    prev = curr
    return prev + fibonacci(a - 1, prev, curr)


def maximum(l):
    if len(l) == 1:
        return l[0]
    m = maximum(l[1:])
    return m if m > l[0] else l[0]


def fibonacci(a, prev=0, curr=1):
    if a == 0:
        return prev
    tmp = curr
    curr += tmp
    prev = curr
    return prev + fibonacci(a - 1, prev, curr)


def fibonacci(a, prev=1, curr=1):
    if a == 0:
        return prev
    tmp = curr
    curr += tmp
    prev = curr
    return prev + fibonacci(a - 1, prev, curr)


def fibonacci(a, prev=1, curr=1):
    if a == 0:
        return prev
    tmp = curr
    curr += pev
    prev = curr
    return prev + fibonacci(a - 1, prev, curr)


def fibonacci(a, prev=1, curr=1):
    if a == 0:
        return prev
    tmp = curr
    curr += prev
    prev = curr
    return prev + fibonacci(a - 1, prev, curr)


def fibonacci(a, prev=1, curr=1):
    if a == 0:
        return prev
    tmp = curr
    curr += prev
    prev = tmp
    return prev + fibonacci(a - 1, prev, curr)


def fibonacci(a, prev=1, curr=1):
    if a == 0:
        return prev
    tmp = curr
    curr += prev
    prev = tmp
    return fibonacci(a - 1, prev, curr)


def maximum(mylist):
    if len(mylist) == 1:
        return mylist[0]
    if mylist[0] < mylist[1]:
        mylist.remove(mylist[0])
        return maximum(mylist)
    else:
        mylist.remove(mylist[1])
        return maximum(mylist)


def count_letters(word):
    if not word:
        return 0
    else:
        return 1 + count_letters(word[1:])


def minimum(a):
    if len(a) == 1:
        return a[0]
    if a[-2] > a[-1]:
        a[-2], a[-1] = a[-1], a[-2]
    a.pop()
    return minimum(a)


def maximum(a):
    if len(a) == 1:
        return a[0]
    if a[-2] < a[-1]:
        a[-2], a[-1] = a[-1], a[-2]
    a.pop()
    return maximum(a)


def power(a, b):
    if b == 0:
        return 1
    return a * power(a, b - 1)

Raise m to the power of n.


Raise m to the power of n.


def count_letters(word, count=0):
    if word == '':
        return count
    else:
        word = word[1:]
    return count_letters(word, count + 1)


def count_letters(s):
    if s == '':
        return 0
    else:
        return 1 + count_letters(s[1:])


def partition(A, p, r):
    q = j = p
    while j < r:
        if A[j] <= A[r]:
            A[q], A[j] = A[j], A[q]
            q += 1
        j += 1
    A[q], A[r] = A[r], A[q]
    return q

def quicksort(A, p, r):
    if r <= p:
        return
    q = partition(A, p, r)
    quicksort(A, p, q - 1)
    quicksort(A, q + 1, r)


def reverse_list(n):
    if n == 1:
        return 0
    else:
        return reverse_list(n - 1)

Recursively reverse a list of elements.


def reverse_list(n):
    if n == 1:
        return 0
    else:
        return reverse_list(n[-1:])

Recursively reverse a list of elements.


def reverse_list(n):
    if n == 1:
        return 0
    else:
        return reverse_list(n)

Recursively reverse a list of elements.


Recursively reverse a list of elements.


def reverse_list(n=[]):
    if len(n) == 1:
        return 0
    else:
        return reverse_list(n - 1)

Recursively reverse a list of elements.


def reverse_list(n=[]):
    if len(n) == 1:
        return 0
    else:
        return reverse_list(n)

Recursively reverse a list of elements.


def reverse_list(n):
    if len(n) == 0:
        return []
    else:
        return [n[-1]] + reverse_list(n[:-1])

Recursively reverse a list of elements.


def count_letters(s, i=0):
    if s == '':
        return 0
    return 1 + count_letters(s[:-1])


def partition(A, p, r):
    q = j = p
    while j < r:
        if A[j] <= A[r]:
            A[q], A[j] = A[j], A[q]
            q += 1
        j += 1
    A[q], A[r] = A[r], A[q]
    return q

def quicksort(A, p, r):
    if r <= p:
        return
    else:
        q = partition(A, p, r)
        quicksort(A, p, q - 1)
        quicksort(A, q + 1, r)


def count_letters(word):
    if word == '':
        return 0
    else:
        return 1 + count_letters(word[1:])


def selectionsort(a):
    i = 0
    while i < len(a):
        p = i
        j = i + 1
        while j < len(a):
            if a[j] < a[p]:
                p = j
            j = j + 1
        tmp = a[p]
        a[p] = a[i]
        a[i] = tmp
        i = i + 1
    return a


def selectionsort(n):
    i = 0
    while i < len(n):
        p = i
        j = i + 1
        while j < len(n):
            if n[j] < n[p]:
                p = j
            j = j + 1
        temp = n[p]
        n[p] = n[i]
        n[i] = temp
        i = i + 1


def fibonacci(n):
    if n == 0 or n == 1:
        return 1
    return fibonacci(n - 1) + fibonacci(n - 2)


def fibonacci(n, first_number=0, second_number=1, counter=0):
    if n == 0:
        return 0
    elif n == 1:
        return 1
    elif n == counter:
        return second_number
    else:
        holder = second_number
        second_number += first_number
        first_number = holder
        return fibonacci(n, first_number, second_number, counter + 1)


def fibonacci(n, first_number=0, second_number=1, counter=0):
    if n == 0:
        print('HEYA')
        return 0
    elif n == 1:
        return 1
    elif n == counter:
        return second_number
    else:
        holder = second_number
        second_number += first_number
        first_number = holder
        return fibonacci(n, first_number, second_number, counter + 1)


def fibonacci(n, first_number=0, second_number=1, counter=0):
    if n == 0:
        return 1
    elif n == 1:
        return 1
    elif n == counter:
        return second_number
    else:
        holder = second_number
        second_number += first_number
        first_number = holder
        return fibonacci(n, first_number, second_number, counter + 1)


def maximum(l):
    if len(l) == 1:
        return l[0]
    if l[0] > l[1]:
        l.remove(l[1])
    else:
        l.remove(l[0])
    return maximum(l)


def power(n, m):
    if m == 1:
        return n
    if m == 0:
        return 1
    return n * power(n, m - 1)

Raise m to the power of n.


Raise m to the power of n.


def minimum(l):
    if len(l) == 1:
        return l[0]
    if l[0] < l[1]:
        l.remove(l[1])
    else:
        l.remove(l[0])
    return minimum(l)


def fibonacci(n):
    if n == 0:
        return 1
    elif n == 1:
        return 1
    return fibonacci(n - 1) + fibonacci(n - 2)


def reverse_list(a):
    if a == []:
        return a
    return reverse_list(a[1:]) + [a[0]]

Recursively reverse a list of elements.


Recursively reverse a list of elements.


def selectionsort(array):
    for i in range(len(array)):
        for j in range(i, len(array)):
            if array[i] > array[j]:
                array[i], array[j] = array[j], array[i]


def power(n, m):
    if m == 1:
        return n
    if m == 0:
        return 1
    return n * (n, m - 1)

Raise m to the power of n.


def minimum(lst):
    if len(lst) == 1:
        return lst[0]
    if lst[0] < lst[1]:
        lst.remove(lst[1])
    else:
        lst.remove(lst[0])
    return minimum(lst)


def maximum(lst):
    if len(lst) == 1:
        return lst[0]
    if lst[0] > lst[1]:
        lst.remove(lst[q])
    else:
        lst.remove(lst[0])
    return maximum(lst)


def maximum(lst):
    if len(lst) == 1:
        return lst[0]
    if lst[0] > lst[1]:
        lst.remove(lst[0])
    else:
        lst.remove(lst[0])
    return maximum(lst)


def maximum(lst):
    if len(lst) == 1:
        return lst[0]
    if lst[0] > lst[1]:
        lst.remove(lst[1])
    else:
        lst.remove(lst[0])
    return maximum(lst)


def power(m, n):
    if n == 0:
        return 1
    return m * power(m, n - 1)

Raise m to the power of n.


def reverse_list(lst):
    l = lst[::-1]
    return l

Recursively reverse a list of elements.


def count_letters(s):
    if s == '':
        return 0
    return 1 + count_letters(s[:-1])


def reverse_list(l):
    if len(l) == 0:
        return []
    a = l[1]
    return reverse_list(l[1:]).append(a)

Recursively reverse a list of elements.


def reverse_list(l):
    if len(l) == 0:
        return []
    a = l[0]
    return reverse_list(l[1:]).append(a)

Recursively reverse a list of elements.


def fibonacci(n):
    if n == 0 or n == 1:
        return 1
    return fibonacci(n - 1) + fibonacci(n - 2)


def reverse_list(l):
    if len(l) == 0:
        return []
    return [l[-1]] + reverse_list(l[:-1])

Recursively reverse a list of elements.


def minimum(l):
    if len(l) == 1:
        return l[0]
    if l[0] > l[1]:
        return minimum(l[1:])
    else:
        return minimum(l[0] + l[2:])


def minimum(l):
    if len(l) == 1:
        return l[0]
    if l[0] > l[1]:
        return minimum(l[1:])
    else:
        return minimum([l[0]] + l[2:])


def maximum(l):
    if len(l) == 1:
        return l[0]
    if l[0] < l[1]:
        return maximum(l[1:])
    else:
        return maximum([l[0]] + l[2:])


def selectionsort(a):
    i = 0
    while i < len(a):
        p = i
        j = i + 1
        while j < len(a):
            if a[j] < a[p]:
                p = j
            j += 1
        a[i], a[p] = a[p], a[i]
        i += 1
    return a


def fibonacci(n):
    if n == 0 or n == 1:
        return 1
    else:
        return fibonacci(n - 1) + fibonacci(n - 2)


def quicksort(A, start, end):
    if end - start < 1:
        return
    i = j = start
    while i <= end:
        if A[i] <= A[end]:
            A[i], A[j] = A[j], A[i]
            j += 1
        i += 1
    quicksort(A, start, j - 2)
    quicksort(A, j, end)


def selectionsort(A):
    for i in range(len(A)):
        min_j = i
        for j in range(i, len(A)):
            if A[j] < A[min_j]:
                min_j = j
        A[i], A[min_j] = A[min_j], A[i]


def power(n, p):
    if p == 0:
        return 1
    else:
        return power(n, p - 1) * n

Raise m to the power of n.


Raise m to the power of n.


def count_letters(s):
    if s == '':
        return 0
    else:
        return 1 + count_letters(s[1:])


def minimum(l):
    if len(l) == 1:
        return l[0]
    else:
        min_ret = minimum(l[1:])
        return l[0] if l[0] < min_ret else min_ret


def maximum(l):
    if len(l) == 1:
        return l[0]
    else:
        max_ret = maximum(l[1:])
        return l[0] if l[0] > max_ret else max_ret


def reverse_list(l):
    if len(l) == 0:
        return []
    else:
        return [l[-1]] + reverse_list(l[:-1])

Recursively reverse a list of elements.


Recursively reverse a list of elements.


def partition(a, start, end):
    j = q = start
    while j < end:
        if a[j] < a[end]:
            a[j], a[q] = a[q], a[j]
            q += 1
        j += 1
    a[end], a[q] = a[q], a[end]
    return q

def quicksort(a, start, end):
    if end <= start:
        return
    q = partition(a, start, end)
    quicksort(a, start, q - 1)
    quicksort(a, q + 1, end)


def power(m, n):
    if n == 1:
        return m
    if n == 0:
        return 1
    return n * power(m, n - 1)

Raise m to the power of n.


def power(m, n):
    if n == 1:
        return m
    if n == 0:
        return 1
    return m * power(m, n - 1)

Raise m to the power of n.


def minimum(n):
    if len(n) == 1:
        return n[0]
    if n[0] < n[1]:
        n.remove(n[1])
    else:
        n.remove(n[0])
    return minimum(n)


def maximum(n):
    if len(n) == 1:
        return n[0]
    if n[0] > n[1]:
        n.remove(n[1])
    else:
        n.remove(n[0])
    return maximum(n)


def count_letters(s):
    if len(s) == 0:
        return 0
    s = list(s)
    s.remove(s[0])
    return 1 + count_letters(s)


def reverse_list(l):
    if len(l) == 0:
        return []
    a = l[-1]
    a.pop()
    return [a] + reverse_list(l)

Recursively reverse a list of elements.


def reverse_list(l):
    if len(l) == 0:
        return []
    a = l[-1]
    l.pop()
    return [a] + reverse_list(l)

Recursively reverse a list of elements.


def fibonacci(n):
    if n == 0:
        return 1
    if n == 1:
        return 1
    return fibonacci(n - 1) + fibonacci(n - 2)


def partition(A, p, r):
    q = j = p
    while j < r:
        if A[j] <= A[r]:
            A[q], A[j] = A[j], A[q]
            q += 1
        j += 1
    A[q], A[r] = A[r], A[q]
    return q

def quicksort(A, p, r):

    def partition(A, p, r):
        q = j = p
        while j < r:
            if A[j] <= A[r]:
                A[q], A[j] = A[j], A[q]
                q += 1
            j += 1
        A[q], A[r] = A[r], A[q]
        return q
    if r <= p:
        return
    q = partition(A, p, r)
    quicksort(A, p, q - 1)
    quicksort(A, q + 1, r)


def selectionsort(a):
    i = 0
    while i < len(a):
        p = i
        j = i + 1
        while j < len(a):
            if a[j] < a[p]:
                p = j
            j += 1
        tmp = a[p]
        a[p] = a[i]
        a[i] = tmp
        i = i + 1


def power(m, n):
    if n == 0:
        return 1
    return m * power(m, n - 1)

Raise m to the power of n.


Raise m to the power of n.


def minimum(n):
    if len(n) == 1:
        return n[0]
    if n[0] < n[1]:
        n.remove(n[1])
        return minimum(n)
    else:
        n.remove(n[0])
        return minimum(n)


def maximum(n):
    if len(n) == 1:
        return n[0]
    if n[0] > n[1]:
        n.remove(n[1])
        return maximum(n)
    else:
        n.remove(n[0])
        return maximum(n)


def power(n, p):
    if p == 0:
        return 1
    else:
        return power(n, p - 1) * n

Raise m to the power of n.


def minimum(l):
    if len(l) == 1:
        return l[0]
    else:
        min_ret = minimum(l[1:])
        return l[0] if l[0] < min_ret else min_ret


def maximum(l):
    if len(l) == 1:
        return l[0]
    else:
        max_ret = maximum(l[1:])
        return l[0] if l[0] > max_ret else max_ret


def count_letters(s):
    if s == '':
        return 0
    else:
        return 1 + count_letters(s[1:])


def fibonacci(h):
    if h == 0 or h == 1:
        return 1
    return fibonacci(h - 1) + fibonacci(h - 2)


def reverse_list(l):
    if len(l) == 0:
        return []
    else:
        return [l[-1]] + reverse_list(l[:-1])

Recursively reverse a list of elements.


Recursively reverse a list of elements.


def fibonacci(n):
    if n == 0 or n == 1:
        return 1
    else:
        return fibonacci(n - 1) + fibonacci(n - 2)


def quicksort(A, start, end):
    if end - start < 1:
        return
    i = j = start
    while i <= end:
        if A[i] <= A[end]:
            A[i], A[j] = A[j], A[i]
            j += 1
        i += 1
    quicksort(A, start, j - 2)
    quicksort(A, j, end)


def selectionsort(A):
    for i in range(len(A)):
        min_j = i
        for j in range(i, len(A)):
            if A[j] < A[min_j]:
                min_j = j
            A[i], A[min_j] = A[min_j], A[i]


def selectionsort(a):
    i = 0
    while i < len(a):
        p = i
        j = i + 1
        while j < len(a):
            if a[j] < a[p]:
                p = j
            j = j + 1
        tmp = a[p]
        a[p] = a[i]
        a[i] = tmp
        i = i + 1


def quicksort(A, p, r):
    if r <= p:
        return
    q = partition(A, p, r)
    quicksort(A, p, q - 1)
    quicksort(A, q + 1, r)


def partition(A, p, r):
    q = j = p
    while j < r:
        if A[j] <= A[r]:
            A[q], A[j] = A[j], A[q]
            q += 1
        j += 1
    A[q], A[r] = A[r], A[q]
    return q

def quicksort(A, p, r):
    if r <= p:
        return
    q = partition(A, p, r)
    quicksort(A, p, q - 1)
    quicksort(A, q + 1, r)


def selectionsort(A, p, r):
    i = 0
    while i < len(a):
        p = i
        j = i + 1
        while j < len(a):
            if a[j] < a[p]:
                p = j
            j = j + 1
        tmp = a[p]
        a[p] = a[i]
        a[i] = tmp
        i = i + 1


def selectionsort(A):
    i = 0
    while i < len(a):
        p = i
        j = i + 1
        while j < len(a):
            if a[j] < a[p]:
                p = j
            j = j + 1
        tmp = a[p]
        a[p] = a[i]
        a[i] = tmp
        i = i + 1


def selectionsort(A):
    i = 0
    while i < len(a):
        p = i
        j = i + 1
        while j < len(a):
            if a[j] < a[p]:
                p = j
            j = j + 1
        a[i], a[p] = a[p], a[i]
        i = i + 1


def selectionsort(a):
    i = 0
    while i < len(a):
        p = i
        j = i + 1
        while j < len(a):
            if a[j] < a[p]:
                p = j
            j = j + 1
        a[i], a[p] = a[p], a[i]
        i = i + 1


def power(a, b):
    if b == 0:
        return 1
    else:
        return power(a, b - 1) * a

Raise m to the power of n.


Raise m to the power of n.


def power(m, n):
    if n == 0:
        return 1
    return m * power(n - 1)

Raise m to the power of n.


def power(m, n):
    if n == 0:
        return 1
    return m * power(m, n - 1)

Raise m to the power of n.


def minimum(l):
    if l == []:
        return []
    temp = minimum(l[1:])
    if len(temp) == 0 or l[0] > temp[0]:
        temp = [l[0]]
    return temp[0]


def minimum(l):
    if l == []:
        return []
    temp = minimum(l[1:])
    print(temp)
    if len(temp) == 0 or l[0] > temp[0]:
        temp = [l[0]]
    return temp[0]


def minimum(l):
    if l == []:
        return []
    temp = minimum(l[1:])
    if l[0] > temp[0]:
        temp = [l[0]]
    return temp[0]


def quicksort(A, p, r):
    if r <= p:
        return
    q = partition(A, p, r)
    quicksort(A, p, q - 1)
    quicksort(A, q + 1, r)

def partition(A, p, r):
    q = j = p
    while j < r:
        if A[j] <= A[r]:
            A[q], A[j] = A[j], A[q]
            q += 1
        j += 1
    A[q], A[r] = A[r], A[q]
    return q

def minimum(l):

    def quicksort(A, p, r):
        if r <= p:
            return
        q = partition(A, p, r)
        quicksort(A, p, q - 1)
        quicksort(A, q + 1, r)

    def partition(A, p, r):
        q = j = p
        while j < r:
            if A[j] <= A[r]:
                A[q], A[j] = A[j], A[q]
                q += 1
            j += 1
        A[q], A[r] = A[r], A[q]
        return q
    return quicksort(l, 0, len(l) - 1)[0]


def quicksort(A, p, r):
    if r <= p:
        return
    q = partition(A, p, r)
    quicksort(A, p, q - 1)
    quicksort(A, q + 1, r)

def partition(A, p, r):
    q = j = p
    while j < r:
        if A[j] <= A[r]:
            A[q], A[j] = A[j], A[q]
            q += 1
        j += 1
    A[q], A[r] = A[r], A[q]
    return q

def minimum(l):

    def quicksort(A, p, r):
        if r <= p:
            return
        q = partition(A, p, r)
        quicksort(A, p, q - 1)
        quicksort(A, q + 1, r)

    def partition(A, p, r):
        q = j = p
        while j < r:
            if A[j] <= A[r]:
                A[q], A[j] = A[j], A[q]
                q += 1
            j += 1
        A[q], A[r] = A[r], A[q]
        return q
    quicksort(l, 0, len(l) - 1)
    return l[0]


def quicksort(A, p, r):
    if r <= p:
        return
    q = partition(A, p, r)
    quicksort(A, p, q - 1)
    quicksort(A, q + 1, r)

def partition(A, p, r):
    q = j = p
    while j < r:
        if A[j] <= A[r]:
            A[q], A[j] = A[j], A[q]
            q += 1
        j += 1
    A[q], A[r] = A[r], A[q]
    return q

def maximum(l):

    def quicksort(A, p, r):
        if r <= p:
            return
        q = partition(A, p, r)
        quicksort(A, p, q - 1)
        quicksort(A, q + 1, r)

    def partition(A, p, r):
        q = j = p
        while j < r:
            if A[j] <= A[r]:
                A[q], A[j] = A[j], A[q]
                q += 1
            j += 1
        A[q], A[r] = A[r], A[q]
        return q
    quicksort(l, 0, len(l) - 1)
    return l[-1]


def selectionsort(a):
    j = 0
    i = 1
    while i < len(a):
        if a[i] < a[j]:
            j = i
        i += 1
    return a


def count_letters(s):
    if s == '':
        return 0
    s = s[1:]
    return 1 + count_letters(s)


def selectionsort(a):
    i = 0
    while i < len(a):
        p, j = i, i + 1
        while j < len(a):
            if a[j] < a[p]:
                p = j
            j += 1
        a[p], a[i] = a[i], a[p]
        i += 1
    return a


def partition(A, p, r):
    q = j = p
    while j > r:
        if A[j] <= A[r]:
            A[q], A[j] = A[j], A[q]
            q += 1
        j += 1
    A[q], A[r] = A[r], A[q]
    return q

def quicksort(A, p, r):

    def partition(A, p, r):
        q = j = p
        while j > r:
            if A[j] <= A[r]:
                A[q], A[j] = A[j], A[q]
                q += 1
            j += 1
        A[q], A[r] = A[r], A[q]
        return q
    if r <= p:
        return
    q = partition(A, p, r)
    quicksort(A, p, q - 1)
    quicksort(A, q + 1, r)


def reverse_list(l):
    if l == []:
        return []
    temp = reverse(l[1:])
    temp.append(l[0])
    return temp

Recursively reverse a list of elements.


def reverse_list(l):
    if l == []:
        return []
    temp = reverse_list(l[1:])
    temp.append(l[0])
    return temp

Recursively reverse a list of elements.


Recursively reverse a list of elements.


def partition(A, p, r):
    q = j = p
    while j < r:
        if A[j] <= A[r]:
            A[q], A[j] = A[j], A[q]
            q += 1
        j += 1
    A[q], A[r] = A[r], A[q]
    return q

def quicksort(A, p, r):

    def partition(A, p, r):
        q = j = p
        while j < r:
            if A[j] <= A[r]:
                A[q], A[j] = A[j], A[q]
                q += 1
            j += 1
        A[q], A[r] = A[r], A[q]
        return q
    if r <= p:
        return
    q = partition(A, p, r)
    quicksort(A, p, q - 1)
    quicksort(A, q + 1, r)


def minimum(a, minimum=None):
    if not a:
        return minimum
    test = a.pop()
    if test < minimum or minimum == None:
        return minimum(a, test)
    else:
        return minimum(a, minimum)


def fibonacci(n):
    if n == 0:
        return 1
    if n == 1:
        return 1
    return fibonacci(n - 1) + fibonacci(n - 2)


def minimum(a, minimum=0):
    if not a:
        return minimum
    test = a.pop()
    if test < minimum or minimum == 0:
        return minimum(a, test)
    else:
        return minimum(a, minimum)