Skip to content

Commit b9d5108

Browse files
Create string.py
1 parent 2eaa8c1 commit b9d5108

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

codevita/12_07_2019/string.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
2+
import re
3+
T=int(input())
4+
l3=[]
5+
if T in range(1,1001):
6+
for i in range(T):
7+
P=input()
8+
S=input()
9+
if len(P)==26 and len(S) in range(1,101) and re.match("[a-z]*$",P) and re.match("[a-z]*$",S):
10+
l4=[]
11+
for j in P:
12+
if j in S:
13+
l4.append(j*S.count(j))
14+
l3.append(l4)
15+
for i in l3:
16+
for j in i:
17+
print(j,end='')
18+
print()
19+
'''
20+
output:
21+
2
22+
asdfghjklpoiuytrewqzxcvbnm
23+
gtnjk
24+
asdfghjklqwertyuiopmnbvcxz
25+
polj
26+
gjktn
27+
jlop
28+
'''

0 commit comments

Comments
 (0)