const repeatedCharacter = function(s) { let dic = {}; for(char of s) { dic[char] = (dic[char] || 0) + 1; if(dic[char] === 2) return char } };