def selection_sort(items):
    """Sort given items by finding minimum item, swapping it with first
    unsorted item, and repeating until all items are in sorted order.
    Running time: O(n**2) As it loops through the whole array for each element
    Memory usage: O(1) Sorting is done in place on the array
    """
    # Loop through each index
    for i in range(len(items)):
        # Find the smallest unsorted value
        ind = items.index(min(items[i:]), i)
        # Switch it with the current index
        items[ind], items[i] = items[i], items[ind]
    return items