st0le
9/22/2013 - 3:59 AM

Naive Triplet

Naive Triplet


def find_triple(arr): #O(n^3)/O(1)
    N = len(arr)
    for i in xrange(N):
        for j in xrange(i+1,N):
            for k in xrange(j+1,N):
                if arr[i] < arr[j] < arr[k]:
                    return arr[i],arr[j],arr[k]
    return None