deleting array duplicate variable

hello all i managed to create two arrays and sort then in to one array in order but now i cant figure out a code to delete any duplicates. below void loop is my prototype function that arranged it.

/*
 * Ruben Padilla
 * 11/7/20
 * lap11p3
 * Assort rays no duplicate
 */
void combine_arr(int x[], int NX, int y[], int NY, int z[]);
void setup()
{
  delay(3000);
  Serial.begin(115200);
  int NX=6,NY=6;
  int x[NX] = { -1, 6, 14, 19, 33,44};
  int y[NY] = { -1, 16, 18, 32, 55, 99};

  int z[NX + NY], i;
  combine_arr(x, NX, y, NY, z);

  for (i = 0; i < (NX + NY); i++)
  {
    Serial.print(z[i]); Serial.print(", ");
  }
}
void loop()
{
  
}

void combine_arr(int x[], int NX, int y[], int NY, int z[])
{
  int i, j, k;
  j = 0; k = 0;
  for (i = 0; i < NX + NY;)
  {
    if (j < NX && k < NY)
    {
      if (x[j] < y[k])
      {
        z[i] = x[j];
        j++;
      }
      else
      {
        z[i] = y[k];
        k++;
      }
        i++;
    }
    else if (j == NX)
    {
      for (; i < NX + NY;)
      { 
        z[i] = y[k];
        k++;
        i++;
      }
    }
    else
    {
      for (; i < NX + NY;)
      {
        z[i] = x[j];
        j++;
        i++;
      }
    }
  }
}

The easiest, but maybe not the most space efficient, is to scan the sorted array and add each element into a new array unless that element is the same value as the last element which was added to the new array.

or maybe if statement?

If you don't want to do 6V6GT's suggestion, then you need to find a way to identify those entries you have "deleted". Even if you go to the trouble of shuffling the entries to eliminate the deleted entry, you still need to do something to eliminate the remaining entry at the bottom of the array.

Will you ALWAYS have the array completely filled with entries at the beginning? What is the purpose of your exercise?

Paul

its a lab class for embedded systems

i think the easy ay would be
if( array[0]==array[1])
{
Serial.print(array[1]);
}
maybe just print them one by one?

sortabler:
its a lab class for embedded systems

i think the easy ay would be
if( array[0]==array[1])
{
Serial.print(array[1]);
}
maybe just print them one by one?

Then you can test a bunch of solutions and find which one you like the best.
Paul

Ok, then scan the sorted array in order and print each element unless that element has the same value as the last element which was printed.