repl.it
@anonymous/

WhiteSnappyAnemoneshrimp

Python 2.7

No description

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
f=lambda l,s:`sorted(s,key=lambda c:[[c<'a',c<'A'or'Z'<c,c>'9'][l[i]]for i in 0,1,2]+[ord(c)])`[2::5]


print f([2, 0, 1]  ,  "a1B2c3")             #->   123acB
print f([2, 1, 0]  ,  "aAaA909UuHWw9gh2")   #->   02999AAHUWaaghuw
print f([2, 1, 0]  ,  "6Bx43")              #->   346Bx
print f([1, 0, 2]  ,  "jfjf33g")            #->   ffgjj33
print f([0, 2, 1]  ,  "AbC13")              #->   b13AC
print f([1, 2, 0]  ,  "Qfl0l")              #->   Q0fll
print f([0, 1, 2]  ,  "9870abcABC")         #->   abcABC0789
print f([0, 2, 1]  ,  "test123")            #->   estt123
print f([2, 0, 1]  ,  "WHAT")               #->   AHTW
print f([2, 0, 1]  ,  "WhAt")               #->   htAW
print f([1, 0, 2]  ,  "102BACbac")          #->   ABCabc012
Fetching token
?