-
Notifications
You must be signed in to change notification settings - Fork 2
/
TestCaseMatcher.py
40 lines (38 loc) · 1.01 KB
/
TestCaseMatcher.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
29
30
31
32
33
34
35
36
37
38
39
40
# Paste program output and original results here in terminal and get them compared
# Made keeping hackerrank in focus
def main():
print("Enter the number of test cases")
n = int(input())
t1 = []
t2 = []
print("\nEnter set 1")
for i in range(n):
inp = input()
while(inp.strip()==""):
inp = input()
t1.append(inp.strip())
print("\nEnter set 2")
for i in range(n):
inp = input()
while(inp.strip()==""):
inp = input()
t2.append(inp.strip())
c = 0
for i in range(n):
if t1[i]!=t2[i]:
c += 1
print("Result will be printed in order of input")
print("\n\n",c," number of mismatches found, show how many? (-1 for all)")
print()
k = int(input())
if k==-1 :
k = c
for i in range(n):
if t1[i]!=t2[i]:
print(i+1,"\t\t",t1[i],"\t\t",t2[i])
k -= 1
if k<=0:
break
print("\n\n Finished ... ")
if __name__=='__main__':
main()