function get_first_repeated_character(s) {
const len = s.length;
for (let i = 0; i < len; i++) {
for (let j = 0; j < i; j++) {
if (s[i] === s[j]) {
return s[i];
}
}
}
return "-1";
}
const s = "abcdxypcbop";
console.log(get_first_repeated_character(s));
/*
run:
c
*/