Generate all triplets of ( arr [ i ] , arr [ j ] , arr [ k ] )
for i in range ( n ) : NEW_LINE INDENT for j in range ( i + 1 , n , 1 ) : NEW_LINE INDENT for k in range ( j + 1 , n , 1 ) : NEW_LINE DEDENT DEDENT