#include <stdio.h>
#include <stdbool.h>
void remove_common_letters(const char *word1, const char *word2, char *result) {
int k = 0;
for (int i = 0; word1[i] != '\0'; i++) {
bool found = false;
for (int j = 0; word2[j] != '\0'; j++) {
if (word1[i] == word2[j]) {
found = true;
break;
}
}
if (!found) {
result[k++] = word1[i];
}
}
result[k] = '\0';
}
int main() {
const char *word1 = "forest";
const char *word2 = "tor";
char result[64];
remove_common_letters(word1, word2, result);
printf("%s\n", result);
return 0;
}
/*
run:
fes
*/