human
k | Returns k - th distinct element in arr ..
Check if current element is present somewhere else ..
If element is unique.
Driver Code"
How can the above be solved in Python?
 What is a code to k and the other steps required?
assistant
#Here is code to k and the other steps required.
 def printKDistinct ( arr , n , k ) :
	dist_count = 0
	for i in range ( n ) :
		j = 0
		while j < n :
			if ( i != j and arr [ j ] == arr [ i ] ) :
				break
			j += 1
		if ( j == n ) :
			dist_count += 1
		if ( dist_count == k ) :
			return arr [ i ]
	return - 1
ar = [ 1 , 2 , 1 , 3 , 4 , 2 ]
n = len ( ar )
k = 2
print ( printKDistinct ( ar , n , k ) )