Constructing a Number

  • + 0 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)