Quotes help make search much faster. Example: "Practice Makes Perfect"

Thursday, December 22, 2016

Codefights def simpleSort(arr)


#sample solution
def simpleSort(arr):

    n = len(arr)

    for i in range(n):
        j = 0
        stop = n - i
        while j < stop - 1:
            if arr[j] > arr[j + 1]:
                temp = arr[j+1]
                arr[j+1] = arr[j]
                arr[j] = temp
            j += 1
    return arr

No comments:

Post a Comment


This is an example of scrolling text using Javascript.

Popular Posts