Final Challenge #2
Lektion 9 von 9 im Kurs Counting Sort - DSA-Serie von Coddy.
Aufgabe
MittelEine weitere Herausforderung.
Schreibe countingSort so, dass es das Array in aufsteigender Reihenfolge sortiert und Duplikate entfernt zurückgibt, sodass jeder Wert genau einmal vorkommt.
Zum Beispiel wird [3, 1, 2, 3, 1] zu [1, 2, 3].
Probier es selbst
#include <stdlib.h>
int* countingSort(int* arr, int arr_size, int* returnSize) {
// Code hier schreiben
*returnSize = arr_size;
return arr;
}