#include <stdio.h>
#include <string.h>
int get_last_character_repeated(char* s) {
int ch_idx = -1;
for (int i = 0; i < s[i]; i++) {
for (int j = i + 1; j < s[i]; j++) {
if (s[i] == s[j]) {
ch_idx = i;
break;
}
}
}
return ch_idx;
}
int main() {
char s[] = "abcdxypcbadom";
int i = get_last_character_repeated(s);
if (i == -1)
printf("Not found\n");
else
printf("%c\n", s[i]);
return 0;
}
/*
d
*/