PY
py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
chars=[];nchars=[]
nums=""
oths="";noths=""
chk=input()
for i in chk:
if i.isalpha():
chars.append(i)
elif i.isdigit():
nums+=str(i)
else:
oths+=i
schars=sorted(set(chars),key=ord)
for i in schars:
if chars.count(i)>1:
nchars.append(i+str(chars.count(i)))
else:
nchars.append(i)
for i in oths:
noths=noths if i in noths else noths+i
print("Input :- ",chk,"\n\n","Output :- ","".join(nchars),"(","".join(sorted(set(nums))),")",noths,sep="")
"""
CHALLENGE : ORDERING THE STRING!
You are given a string, you have to arrange its each character in the following order:
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run