Skip to main content
Commonmark migration
Source Link

Python 2, 75 69 bytes

def f(s):len({2<<s.count(c)-2for c,in s})<2or{{e.dil:-tu,r.dil:-tu,}} 

Output is via presence or absence of an error. The error is either a ValueError (one or more characters occur only once) or a NameError (the character counts are unequal).

Try it online!

Python 2, 75 69 bytes

def f(s):len({2<<s.count(c)-2for c,in s})<2or{{e.dil:-tu,r.dil:-tu,}} 

Output is via presence or absence of an error. The error is either a ValueError (one or more characters occur only once) or a NameError (the character counts are unequal).

Try it online!

Python 2, 75 69 bytes

def f(s):len({2<<s.count(c)-2for c,in s})<2or{{e.dil:-tu,r.dil:-tu,}} 

Output is via presence or absence of an error. The error is either a ValueError (one or more characters occur only once) or a NameError (the character counts are unequal).

Try it online!

deleted 4 characters in body
Source Link
Dennis
  • 211.7k
  • 41
  • 380
  • 830

Python 2, 7575 69 bytes

def f(s):len({2<<s.count(c)-2for c,in s})>1<<2or{{ddeiillorrttuue.dil:-1tu,r.>>dil:-2.tu,}:1,} 

Output is via presence or absence of an error. The error is either a ValueError (one or more characters occur only once) or a TypeErrorNameError (the character counts are unequal).

Try it online!Try it online!

Python 2, 75 bytes

def f(s):len({2<<s.count(c)-2for c,in s})>1<{{ddeiillorrttuu:-1.>>-2.,}:1,} 

Output is via presence or absence of an error. The error is either a ValueError (one or more characters occur only once) or a TypeError (the character counts are unequal).

Try it online!

Python 2, 75 69 bytes

def f(s):len({2<<s.count(c)-2for c,in s})<2or{{e.dil:-tu,r.dil:-tu,}} 

Output is via presence or absence of an error. The error is either a ValueError (one or more characters occur only once) or a NameError (the character counts are unequal).

Try it online!

Source Link
Dennis
  • 211.7k
  • 41
  • 380
  • 830

Python 2, 75 bytes

def f(s):len({2<<s.count(c)-2for c,in s})>1<{{ddeiillorrttuu:-1.>>-2.,}:1,} 

Output is via presence or absence of an error. The error is either a ValueError (one or more characters occur only once) or a TypeError (the character counts are unequal).

Try it online!