2022-10-27 15:07:13 +00:00
|
|
|
export function mostUsedChar(text) {
|
2022-10-28 12:27:02 +00:00
|
|
|
let h = new Set();
|
|
|
|
|
|
|
|
for(let i = 1; i <= text.length - 1; i++)
|
|
|
|
{
|
|
|
|
let c = text[i];
|
|
|
|
|
|
|
|
if (h.has(c))
|
|
|
|
return c;
|
|
|
|
|
|
|
|
else
|
|
|
|
h.add(c);
|
|
|
|
}
|
|
|
|
return '\0';
|
2022-10-27 15:07:13 +00:00
|
|
|
}
|