Shashank and List

  • + 1 comment

    My code is giving timeout on case 7,8,9,10. can anyone help?

    import sys
    import math
    T = int(input())
    N=[]
    res=1
    
    n=input().strip().split(' ')
    for j in n :
    	N.append(int(j))
    
    for i in N:
    	res=res*(2**i+1)%(10**9 + 7)
    	
    print(res-1)