You are viewing a single comment's thread. Return to all comments →
Javascript:
function gameOfThrones(s) { let result = Array(26).fill(0); s.split('').forEach((char) => { result[char.charCodeAt(0)-'a'.charCodeAt(0)]++; }); let odds = 0; result.forEach((count) => { if (count%2 !== 0) odds++; }); return odds > 1 ? 'NO' : 'YES'; };
Seems like cookies are disabled on this browser, please enable them to open this website
Game of Thrones - I
You are viewing a single comment's thread. Return to all comments →
Javascript: