Revision 869f8c66-db06-40a5-8167-4cc993b80157 - Code Golf Stack Exchange

#Python 3.5, <strike>142</strike> <strike>137</strike> <strike>134</strike> <strike>112</strike> 117 bytes:

(*+5 bytes because of a fix for a small bug*)

 def g(u):import re;q=re.findall(r"\b['\w]+\b",u.lower());Q=q.count;return max(q,key=Q)if len(set(Q(i)for i in q))>1else''

Regular expressions really helped in this challenge! :) This submission does **not** assume that least two words are input. In other words, this should work for an input any number of words, including 0 words.

[Try It Online! (Ideone)][1]


 [1]: http://ideone.com/mDHfbA

AltStyle によって変換されたページ (->オリジナル) /