As Eri523 stated, the assignment is rather tricky. However, assuming I've correctly understood the requirements, one possible simple way of coding it using c could be

Code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int no_same(const char* key, const char* value)
{
int	fnd = 0;

char	*copy,
	*ind;

	if (key == NULL || value == NULL) return 0;

	if ((copy = (char*)malloc(strlen(value + 1))) == NULL) return 0;

	strcpy(copy, value);

	while (*key) {
		if (ind = strchr(copy, *key)) {
			*ind = 1;
			fnd++;
		}
		key++;
	}

	free(copy);
	return fnd;
}


int main()
{
const char *vals[] = {"1154", "1179", "2154", "2554", "2484", "2144", "4515", "1144", "1517", "4815", "1481"};

const char *key = "1154";

const int noval = sizeof(vals) / sizeof(vals[0]);

int i;

	for (i = 0; i < noval; i++)
		printf("%s when compared to %s == %s\n", key, vals[i], no_same(key, vals[i]) >= 3 ? "true" : "false");

	return 0;
}
This gives the required output of

1154 when compared to 1154 == true
1154 when compared to 1179 == false
1154 when compared to 2154 == true
1154 when compared to 2554 == false
1154 when compared to 2484 == false
1154 when compared to 2144 == false
1154 when compared to 4515 == true
1154 when compared to 1144 == true
1154 when compared to 1517 == true
1154 when compared to 4815 == true
1154 when compared to 1481 == true