C
c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
int value(int a[]){
int i[3]={},s,n[3]={},*p[4]={};
for(i[0]=1;i[0]<5;i[0]++){
//memorize lowest value for 'straight'detection
if(!n[2]) n[2]=a[0];
else if(n[2]>a[i[0]]) n[2]=a[i[0]];
//---------------------------------------
//memorize array location that has different value from first array (array a) and save it in a pointer array (pointer p)
if(a[0]==a[i[0]]) n[0]++;
else{
p[i[1]]=&a[i[0]];
//printf("%p ",p[i[1]]);
//printf("%d ",*p[i[1]]);
i[1]++;}
}
//printf("\n");
//----------------------------------------
//compare value of pointer array with its value of first array pointer then reconfigure the pointer array value
while(i[1]>1){
s=i[1]; i[1]=0;
for(i[0]=1;i[0]<s;i[0]++){
if(*p[0]==*p[i[0]]){
n[1]++;
p[i[0]]=NULL;}
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run