# Python, 132 bytes import collections as C,re def g(s):(a,i),(b,j)=C.Counter(re.sub('[^\w\s-]','',s.lower()).split()).most_common(2);return[a,''][i==j] Above code assumes input has at least two words.