human
Can you provide a code to find sum of non and the other steps required given the following:
Find sum of non | Find the sum of all non - repeated elements in an array.
sort all elements of array.
Driver code"
Solution in Python:
assistant
#Here is code to find sum of non and the other steps required.
 def findSum ( arr , n ) :
	arr . sort ( )
	sum = arr [ 0 ]
	for i in range ( 0 , n - 1 ) :
		if ( arr [ i ] != arr [ i + 1 ] ) :
			sum = sum + arr [ i + 1 ]
	return sum
def main ( ) :
	arr = [ 1 , 2 , 3 , 1 , 1 , 4 , 5 , 6 ]
	n = len ( arr )
	print ( findSum ( arr , n ) )
if __name__ == ' _ _ main _ _ ' :
	main ( )