← Back to List

21059번: Methodic Multiplication ↗

Solutions

Python 3
125 B | 125 chars
a = input().count("S(")
b = input().count("S(")

if a * b == 0:
    print(0)
else:
    d = a * b
    print("S("*d+"0"+")"*d)