Skip to main content
added 4 characters in body
Source Link
TFeld
  • 19.9k
  • 3
  • 20
  • 63

Python 2, 115 bytes

Python 2, 116 bytes

def f(s):a=s.lower();return''.join(`n`+s[a.findrfind(c)] for n,c in sorted((a.count(c),c)for c in set(a)if c.isalpha()))

Try it online!Try it online!

Python 2, 115 bytes

def f(s):a=s.lower();return''.join(`n`+s[a.find(c)] for n,c in sorted((a.count(c),c)for c in set(a)if c.isalpha()))

Try it online!

Python 2, 116 bytes

def f(s):a=s.lower();return''.join(`n`+s[a.rfind(c)] for n,c in sorted((a.count(c),c)for c in set(a)if c.isalpha()))

Try it online!

added 24 characters in body
Source Link
TFeld
  • 19.9k
  • 3
  • 20
  • 63

Python 2, 99 bytes

Python 2, 115 bytes

def f(s):a=s.lower();return''.join(`n`+s[a.find(c)] for n,c in sorted(`a(a.count(c)`+s[a.rfind(,c)]forfor c in set(a)if c.isalpha()))

Try it online!Try it online!

Python 2, 99 bytes

def f(s):a=s.lower();return''.join(sorted(`a.count(c)`+s[a.rfind(c)]for c in set(a)if c.isalpha()))

Try it online!

Python 2, 115 bytes

def f(s):a=s.lower();return''.join(`n`+s[a.find(c)] for n,c in sorted((a.count(c),c)for c in set(a)if c.isalpha()))

Try it online!

Source Link
TFeld
  • 19.9k
  • 3
  • 20
  • 63

Python 2, 99 bytes

def f(s):a=s.lower();return''.join(sorted(`a.count(c)`+s[a.rfind(c)]for c in set(a)if c.isalpha()))

Try it online!