You are viewing a single comment's thread. Return to all comments →
python 3
def canConstruct(a):
sum1=0 for i in a: sum1+=i%3 if(sum1%3==0): print("Yes") else: print("No")
if name == 'main':
t = int(input().strip()) for t_itr in range(t): n = int(input().strip()) a = list(map(int, input().split())) canConstruct(a)
Seems like cookies are disabled on this browser, please enable them to open this website
Constructing a Number
You are viewing a single comment's thread. Return to all comments →
python 3
def canConstruct(a):
if name == 'main':