def selection_sort(li):
    """ [list of int] => [list of int]
    Selection sort: finds the minimum value, swaps it with the
    value in the first position, and repeats these steps for
    the remainder of the list.
    """

    sorted_list = li

    # iterate as many times as the list is long
    for i in range(len(sorted_list)):
        # initial minimum is just the first value of the unsorted list
        min_index = i

        # find the minimum in the unsorted list
        for j in range(i, len(sorted_list)):
            # if current is less than current min set new minimum
            if sorted_list[j] < sorted_list[min_index]:
                min_index = j

        # swap the minimum and start of unsorted list
        sorted_list[i], sorted_list[min_index] = sorted_list[min_index], sorted_list[i]

    return sorted_list