Design a way to sort the list of positive integers in the descending order according to frequency of elements. The elements with integers with higher frequency come before with lower frequency elements with same frequency come in the same order as they appear the values.

Consider the following I/O samples. SAMPLE INPUT: 6 2 2 4 9 9 9 SAMPLE OUTPUT: 9 9 9 2 2 4 C PROGRAM: #include <stdio.h> #include<limits.h> #include<malloc.h> int * frequencySortArray( int *arr,int size) { int** occurence = NULL; int maxpos, count = 0, count_flag, o_row, index,max; int newindex = 0, num, ctr; occurence = (int**)calloc(1,sizeof(int*)); occurence[0] = (int*)calloc(2,sizeof(int)); occurence[0][0] = arr[0]; occurence[0][1]++; count++; for(index = 1 ; index < size ; index++) { ...