def selection_sort(array):
    """ Selection sort implementation

    Arguments:
        - array : (int[]) array of int to sort

    Returns:
        - array : (int[]) sorted numbers
    """
    for slot in range(len(array)-1,0,-1):
        maxpos = 0
        for index in range(slot+1):
           if array[index] > array[maxpos]:
               maxpos = index
        temp = array[slot]
        array[slot] = array[maxpos]
        array[maxpos] = temp
    return array