#Python 3.5, (削除) 142 (削除ここまで)(削除) 137 (削除ここまで)(削除) 134 (削除ここまで)(削除) 112 (削除ここまで)(削除) 117 (削除ここまで)(削除) 110 (削除ここまで) 127 bytes:
Python 3.5, (削除) 142 (削除ここまで)(削除) 137 (削除ここまで)(削除) 134 (削除ここまで)(削除) 112 (削除ここまで)(削除) 117 (削除ここまで)(削除) 110 (削除ここまで) 127 bytes:
(+17 bytes, because apparently even if there are words more frequent than the rest, but they have the same frequency, nothing should still be returned.)
def g(u):import re;q=re.findall(r"\b['\-\w]+\b",u.lower());Q=q.count;D=[*map(Q,{*q})];return['',max(q,key=Q)][1in map(D.count,D)]
Should now satisfy all conditions. This submission assumes that at least 1 word is input.
Also, if you want one, here is another version of my function devoid of any regular expressions at the cost of about 43 bytes, though this one is non-competitive anyways, so it does not really matter. I just put it here for the heck of it:
def g(u):import re;q=''.join([i for i in u.lower()if i in[*map(chr,range(97,123)),*"'- "]]).split();Q=q.count;D=[*map(Q,{*q})];return['',max(q,key=Q)][1in map(D.count,D)]
#Python 3.5, (削除) 142 (削除ここまで)(削除) 137 (削除ここまで)(削除) 134 (削除ここまで)(削除) 112 (削除ここまで)(削除) 117 (削除ここまで)(削除) 110 (削除ここまで) 127 bytes:
(+17 bytes, because apparently even if there are words more frequent than the rest, but they have the same frequency, nothing should still be returned.)
def g(u):import re;q=re.findall(r"\b['\-\w]+\b",u.lower());Q=q.count;D=[*map(Q,{*q})];return['',max(q,key=Q)][1in map(D.count,D)]
Should now satisfy all conditions. This submission assumes that at least 1 word is input.
Also, if you want one, here is another version of my function devoid of any regular expressions at the cost of about 43 bytes, though this one is non-competitive anyways, so it does not really matter. I just put it here for the heck of it:
def g(u):import re;q=''.join([i for i in u.lower()if i in[*map(chr,range(97,123)),*"'- "]]).split();Q=q.count;D=[*map(Q,{*q})];return['',max(q,key=Q)][1in map(D.count,D)]
Python 3.5, (削除) 142 (削除ここまで)(削除) 137 (削除ここまで)(削除) 134 (削除ここまで)(削除) 112 (削除ここまで)(削除) 117 (削除ここまで)(削除) 110 (削除ここまで) 127 bytes:
(+17 bytes, because apparently even if there are words more frequent than the rest, but they have the same frequency, nothing should still be returned.)
def g(u):import re;q=re.findall(r"\b['\-\w]+\b",u.lower());Q=q.count;D=[*map(Q,{*q})];return['',max(q,key=Q)][1in map(D.count,D)]
Should now satisfy all conditions. This submission assumes that at least 1 word is input.
Also, if you want one, here is another version of my function devoid of any regular expressions at the cost of about 43 bytes, though this one is non-competitive anyways, so it does not really matter. I just put it here for the heck of it:
def g(u):import re;q=''.join([i for i in u.lower()if i in[*map(chr,range(97,123)),*"'- "]]).split();Q=q.count;D=[*map(Q,{*q})];return['',max(q,key=Q)][1in map(D.count,D)]
#Python 3.5, (削除) 142 (削除ここまで) (削除) 137 (削除ここまで) (削除) 134 (削除ここまで) (削除) 112 (削除ここまで) (削除) 117 (削除ここまで) (削除) 110 (削除ここまで) 127 bytes:
(+17 bytes, because apparently even if there are words more frequent than the rest, but they have the same frequency, nothing should still be returned.)
def g(u):import re;q=re.findall(r"\b['\-\w]+\b",u.lower());Q=q.count;D=[*map(Q,{*q})];return['',max(q,key=Q)][1in map(D.count,D)]
def g(u):import re;q=re.findall(r"\b['\-\w]+\b",u.lower());Q=q.count;D=[*map(Q,{*q})];return['',max(q,key=Q)][1in map(D.count,D)]
Should now satisfy all conditions. This submission assumes that at least 1 word is input.
Also, if you want one, here is another version of my function devoid of any regular expressions at the cost of about 43 bytes, though this one is non-competitive anyways, so it does not really matter. I just put it here for the heck of it:
def g(u):import re;q=''.join([i for i in u.lower()if i in[*map(chr,range(97,123)),*"'- "]]).split();Q=q.count;D=[*map(Q,{*q})];return['',max(q,key=Q)][1in map(D.count,D)]
def g(u):import re;q=''.join([i for i in u.lower()if i in[*map(chr,range(97,123)),*"'- "]]).split();Q=q.count;D=[*map(Q,{*q})];return['',max(q,key=Q)][1in map(D.count,D)]
#Python 3.5, (削除) 142 (削除ここまで) (削除) 137 (削除ここまで) (削除) 134 (削除ここまで) (削除) 112 (削除ここまで) (削除) 117 (削除ここまで) (削除) 110 (削除ここまで) 127 bytes:
(+17 bytes because apparently even if there are words more frequent than the rest, but they have the same frequency, nothing should still be returned.)
def g(u):import re;q=re.findall(r"\b['\-\w]+\b",u.lower());Q=q.count;D=[*map(Q,{*q})];return['',max(q,key=Q)][1in map(D.count,D)]
Should now satisfy all conditions. This submission assumes that at least 1 word is input.
Also, if you want one, here is another version of my function devoid of any regular expressions at the cost of about 43 bytes, though this one is non-competitive anyways, so it does not really matter. I just put it here for the heck of it:
def g(u):import re;q=''.join([i for i in u.lower()if i in[*map(chr,range(97,123)),*"'- "]]).split();Q=q.count;D=[*map(Q,{*q})];return['',max(q,key=Q)][1in map(D.count,D)]
#Python 3.5, (削除) 142 (削除ここまで) (削除) 137 (削除ここまで) (削除) 134 (削除ここまで) (削除) 112 (削除ここまで) (削除) 117 (削除ここまで) (削除) 110 (削除ここまで) 127 bytes:
(+17 bytes, because apparently even if there are words more frequent than the rest, but they have the same frequency, nothing should still be returned.)
def g(u):import re;q=re.findall(r"\b['\-\w]+\b",u.lower());Q=q.count;D=[*map(Q,{*q})];return['',max(q,key=Q)][1in map(D.count,D)]
Should now satisfy all conditions. This submission assumes that at least 1 word is input.
Also, if you want one, here is another version of my function devoid of any regular expressions at the cost of about 43 bytes, though this one is non-competitive anyways, so it does not really matter. I just put it here for the heck of it:
def g(u):import re;q=''.join([i for i in u.lower()if i in[*map(chr,range(97,123)),*"'- "]]).split();Q=q.count;D=[*map(Q,{*q})];return['',max(q,key=Q)][1in map(D.count,D)]
#Python 3.5, (削除) 142 (削除ここまで) (削除) 137 (削除ここまで) (削除) 134 (削除ここまで) (削除) 112 (削除ここまで) (削除) 117 (削除ここまで) (削除) 110 (削除ここまで) 127 bytes:
(+17 bytes because apparently even if there are words more frequent than the rest, but they have the same frequency, nothing should still be returned.)
def g(u):import re;q=re.findall(r"\b['\-\w]+\b",u.lower());Q=q.count;D=[*map(Q,{*q})];return['',max(q,key=Q)][1in map(D.count,D)]
Should now satisfy all conditions. This submission assumes that at least 1 word is input.
Also, if you want one, here is another version of my function devoid of any regular expressions at the cost of about 43 bytes, though this one is non-competitive anyways, so it does not really matter. I just put it here for the heck of it:
def g(u):import re;q=''.join([i for i in u.lower()if i in[*map(chr,range(97,123)),*"'- "]]).split();Q=q.count;D=[*map(Q,{*q})];return['',max(q,key=Q)][1in map(D.count,D)]
#Python 3.5, (削除) 142 (削除ここまで) (削除) 137 (削除ここまで) (削除) 134 (削除ここまで) (削除) 112 (削除ここまで) (削除) 117 (削除ここまで) (削除) 110 (削除ここまで) 127 bytes:
(+17 bytes because apparently even if there words more frequent than the rest, but they have the same frequency, nothing should still be returned.)
def g(u):import re;q=re.findall(r"\b['\-\w]+\b",u.lower());Q=q.count;D=[*map(Q,{*q})];return['',max(q,key=Q)][1in map(D.count,D)]
Should now satisfy all conditions. This submission assumes that at least 1 word is input.
Also, if you want one, here is another version of my function devoid of any regular expressions at the cost of about 43 bytes, though this one is non-competitive anyways, so it does not really matter. I just put it here for the heck of it:
def g(u):import re;q=''.join([i for i in u.lower()if i in[*map(chr,range(97,123)),*"'- "]]).split();Q=q.count;D=[*map(Q,{*q})];return['',max(q,key=Q)][1in map(D.count,D)]
#Python 3.5, (削除) 142 (削除ここまで) (削除) 137 (削除ここまで) (削除) 134 (削除ここまで) (削除) 112 (削除ここまで) (削除) 117 (削除ここまで) (削除) 110 (削除ここまで) 127 bytes:
(+17 bytes because apparently even if there are words more frequent than the rest, but they have the same frequency, nothing should still be returned.)
def g(u):import re;q=re.findall(r"\b['\-\w]+\b",u.lower());Q=q.count;D=[*map(Q,{*q})];return['',max(q,key=Q)][1in map(D.count,D)]
Should now satisfy all conditions. This submission assumes that at least 1 word is input.
Also, if you want one, here is another version of my function devoid of any regular expressions at the cost of about 43 bytes, though this one is non-competitive anyways, so it does not really matter. I just put it here for the heck of it:
def g(u):import re;q=''.join([i for i in u.lower()if i in[*map(chr,range(97,123)),*"'- "]]).split();Q=q.count;D=[*map(Q,{*q})];return['',max(q,key=Q)][1in map(D.count,D)]
- 5k
- 2
- 16
- 38
- 5k
- 2
- 16
- 38