def combsort(array, scaling_factor):
    """
    combsort(array, scaling_factor) -> list
    
    array -> [list]: A list of elements to be sorted using combsort 
    scaling_factor -> [float]: A scalar that reduces the size of the
    gap every sweep (>1)
    """

    steps = 0    
    gap = len(array)
    
    while True:
        swapped = False
        
        # Reduce the gap
        # We can safely cast gap to int after every divide
        # because int() floors the float result of 
        # the division, ensuring that gap is always
        # smaller every sweep
        gap = int(gap / scaling_factor)

        for i in range (len(array) - gap):
            if (array[i] > array[i + gap]):
                # Swap!
                array[i + gap], array[i] = array[i], array[i + gap]
                swapped = True
            
            steps += 1
            
        if not swapped and gap == 0:
            break;
    
    return array, steps