Can anybody tell me why uncommented solution is giving wrong answer, but the commented one is correct? what’s the difference between them??
for _ in range(int(input())):
n,k = map(int, input().strip().split())
a = list(map(int, input().strip().split()))
for i in a:
if i%k==0: print(‘1’, end=’’)
else: print(‘0’, end=’’)
# for test in range(int(input())):
# d, k=map(int, input().strip().split())
# distances=list(map(int, input().strip().split()))
# ans=[]
# for dist in distances:
# if dist%k==0:
# ans.append('1')
# else: ans.append('0')
# print(''.join(ans))