We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 101ea31 commit cb35bbaCopy full SHA for cb35bba
ip.txt
@@ -1,4 +1,3 @@
1
-1
2
-6
3
-10 5 50 1 40 100
4
-5 45
+2
+YX X XXY
+XY X XXY
str_interleaving.py
@@ -0,0 +1,24 @@
+# SHIV's code for string interleaving
+
+'''
5
6
7
8
9
+tn = int(input())
10
11
+def process(a, b, c):
12
+ left = []
13
+ if len(a) > len(b):
14
+ left = a[len(b):]
15
+ C = [x+y for x,y in zip(a[:len(b)], b)]
16
+ elif len(b) > len(a):
17
+ left = b[len(a):]
18
+ C = [x+y for x,y in zip(a, b[:len(a)])]
19
+ if ''.join(C)+left == c: return True
20
+ return False
21
22
+for i in range(tn):
23
+ a, b, c = input().split()
24
+ print(process(a, b, c))
0 commit comments