Monday, July 2, 2018

MIRRORED - Mirrored Pairs : Tutorial

#The solution in Python 3 is as follows:


b=[]
while True:
     x=input()
     if x=="  ":
            print("Ready")
            for i in range(len(b)):
                    print(b[i])
            break
    if x=='pq' or x=='qp' or x=='db' or x=='bd':
           b.append("Mirrored pair")
    else:
           b.append("Ordinary pair")


#Keep visiting for more solutions of SPOJ problems in Python 3.Thank you!!!