The below code will help you to solve the given problem and you can execute and cross verify with sample input and output.
#include<stdio.h>
#include<string.h>
int* uniqueValue(int input1,int input2[])
{
int left, current;
static int arr[4] = {0};
int i = 0;
for(i=0;i<input1;i++)
{
current = input2[i];
left = 0;
if(current > 0)
left = arr[(current-1)];
if(left == 0 && arr[current] == 0)
{
arr[current] = input1-current;
}
else
{
for(int j=(i+1);j<input1;j++)
{
if(arr[j] == 0)
{
left = arr[(j-1)];
arr[j] = left - 1;
}
}
}
}
return arr;
}