Untitled

 avatar
unknown
plain_text
3 years ago
335 B
6
Indexable
for q in range(int(input())):
    n=int(input())
    s=input()
    g=[int(d) for d in str(s)]
    b=[]
    while (len(g)!=0):
        if g.pop(0)==0:
            b.insert(0,"0")
        else:
            b.append("1")
        if g.pop()==1:
            b.insert(0,"1")
        else:
            b.append("0")
    print("".join(b))
    
Editor is loading...