human
What is a code to print sorted distinct elements of array and the other steps required given the following:
Print sorted distinct elements of array | Python3 program to print sorted distinct elements ..
Create a set using array elements.
Print contents of the set ..
Driver code"
Solution in Python:
assistant
#Here is code to print sorted distinct elements of array and the other steps required.
 def printRepeating ( arr , size ) :
	s = set ( )
	for i in range ( size ) :
		if arr [ i ] not in s :
			s . add ( arr [ i ] )
	for i in s :
		print ( i , end = " ▁ " )
if __name__ == ' _ _ main _ _ ' :
	arr = [ 1 , 3 , 2 , 2 , 1 ]
	size = len ( arr )
	printRepeating ( arr , size )