def selection_sort(numbs: list) -> list:
    """
    Go through the list from left to right and search for the
    minimum. Once the minimum is found, swap it with the
    element at the end of the array. Repeat the same procedure
    on the subarray that goes from the element after 'i' to the
    end, until the array is sorted (i.e. when the subarray is
    composed of only one element).

    :param numbs: The array to be sorted
    :return: The sorted array
    """
    for i in range(len(numbs)):
        minimum = i

        for j in range(i + 1, len(numbs)):
            if numbs[minimum] > numbs[j]:
                minimum = j

        numbs[i], numbs[minimum] = numbs[minimum], numbs[i]

    return numbs