stock HasDuplicateValues(array[], size = sizeof array){ for(new f = 0; f < size - 1; f++) for(new c = f + 1; c < size; c++) if(array[f] == array[c]) return true; return false;}
newarr[] = { 21, 34, 45, 15, 56, 123, 34, 67 },arr2[] = { 21, 34, 45, 56, 123, 36, 67 },arr3[] = { 2, 5, 34, 56, 332, 67, 32, 43, 6554, 1234, 542},arr4[] = { 4, 8, 10, 12, 3, -45, -78, 45, -78, 90},arr5[] = { \'x\', \'d\', \'s\', \'e\', \'t\', \'r\', \'o\', 67, 23, \'r\'};printf(\"Duplicate value in array? %s\", (HasDuplicateValues(arr))?(\"Yes\")\"No\"));printf(\"Duplicate value in array? %s\", (HasDuplicateValues(arr2))?(\"Yes\")\"No\"));printf(\"Duplicate value in array? %s\", (HasDuplicateValues(arr3))?(\"Yes\")\"No\"));printf(\"Duplicate value in array? %s\", (HasDuplicateValues(arr4))?(\"Yes\")\"No\"));printf(\"Duplicate value in array? %s\", (HasDuplicateValues(arr5))?(\"Yes\")\"No\"));/*[17:23:20] Duplicate value in array? Yes[17:23:20] Duplicate value in array? No[17:23:20] Duplicate value in array? No[17:23:20] Duplicate value in array? Yes[17:23:20] Duplicate value in array? Yes*/