title: K Th Distinct Or Non Repeating Element In An Array
signature: kThDistinctOrNonRepeatingElementInAnArray(arr, n, k) {
source_py: def k_th_distinct_or_non_repeating_element_in_an_array(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)
source_cpp: int k_th_distinct_or_non_repeating_element_in_an_array(vector<int> arr, int n, int k) {
    int dist_count = 0;
    for ( int i = 0;
    i < n;
    i ++ ) {
      int j;
      for ( j = 0;
      j < n;
      j ++ ) if ( i != j && arr [ j ] == arr [ i ] ) break;
      if ( j == n ) dist_count ++;
      if ( dist_count == k ) return arr [ i ];
    }
    return - 1;
  }